andysworkshop / stm32plus

The C++ library for the STM32 F0, F100, F103, F107 and F4 microcontrollers
http://www.andybrown.me.uk
Other
745 stars 224 forks source link

LLM-Generated Documentation Experiment for stm32plus (Gemini Pro, 1.2M Tokens) #236

Open plops opened 4 months ago

plops commented 4 months ago

Hi Andy, I've been experimenting with using Google's Gemini Pro model to generate documentation for stm32plus, focusing on areas I'm particularly interested in. I fed it a curated 3.9MB selection of source files as context (1.2M tokens). The result is a structured outline, with sections covering core library components, peripherals, and examples. I even started adding UML diagrams, but unfortunately, my browser crashed after the first one. While each request takes several minutes, it's still significantly faster than writing everything manually.

You can find the generated documentation in my fork: https://github.com/plops/stm32plus/tree/feature/llm_documentation/doc

Based on previous experiments, I believe this documentation could be quite helpful, especially since LLMs tend to avoid excessive "hallucination" when summarizing code.

Feel free to take a look when you have a moment.