Creating Documentation with AI


AI is great at producing documentation. Point it at a folder of text and images and get it to make sense of the contents and produce documentation, or better yet, as a Developer, point it at a folder of source code and get it to document it. You may even learn something about your own software that you had forgotten 🙂 It may even point out flaws or unexpected side effects, according to a friend, this has never happened to me … moving swiftly on …


I’ve developed a very simple prompt that I use which gives me great results and I usually use Claude Code with the Sonnet 4.6 model. However as local AI is improving rapidly I thought it would be fun and interesting to compare the output from Claude Code with that of a couple of local LLMs. It may currently only take a dollar or two to use Claude Code for this task but given that prompt costs are currently heavily subsidised, and even in 2026 it’s sometimes possible to be without a stable internet connection, it makes sense to try alternatives.


When using local LLMs for a job like this I am currently testing Cline (https://cline.bot/). This gives a Claude Code type experience within VS Code. A terminal version of Cline is also available but I had some TUI effects that I’ve not yet bothered to get to the bottom of. The VS Code installation however was flawless.


The Prompt

The prompt I used was this:

Write a professional and in depth combined user and developer documentation for this application. Output as a self contained html file named: appname_Documentation saved to the project/Documentation directory. Use graphs and charts if possible to make the document as visual as possible. Avoid dark backgrounds and if text is on a dark background make the contrast significant for easy readability. 


The Project

The project I was using to test the documentation creation is a simple Python application; 

PyTrain1 is a lightweight, command-line Python application that automates a three-stage data extraction pipeline. It connects to a Microsoft SQL Server database, runs a SELECT query against a customer table, and exports the results to a CSV file on the local machine, all in a single run with no user interaction required.

The application serves as a training exercise in combining SQLAlchemy, pyodbc, and pandas to extract and export relational data with minimal code. It runs as a single script with no web server, background process, or GUI component.

And yes, AI did write the above description, I couldn’t have done it better myself.


The Computer


2025 Mac Studio Max with 64 Gb RAM, 16 CPU cores and 40 GPU cores.


First Test: Sonnet 4.6


Second Test: Qwen3.6-35b-a3b-mlx


The image below shows the LLM loaded into LM Studio.


The image below is Cline running against Qwen in VS Code.


In this image, below, you can see the activity on my computer, with the memory usage and GPU usage shown plainly. Note I was also running a Windows 11 VM at the time.


Third Test: Gemma 4 3b


Fourth Test: Llama 3.3 70b Instruct


The Results


The results shown above don’t tell the whole story. The instant take away (as expected) is that Claude produced the highest quality documentation. What I didn’t expect is how good the output from Qwen was, and also how fast it was compared to Claude.


I expected better from Gemma. Gemma named the output file incorrectly, gave great feedback during the process, finished quickly but gave only a few lines of output. So, a failure. I will show some sample output later in this document, at least for those that created output … this brings me to Llama. 


Llama was not happy. I left it running for 15 minutes or so during which time it had numerous issues and errors and produced some strange commentary including telling me the temperature and humidity in San Francisco! I’m in the UK. I don’t know whether it had an issue with Cline but a big difference is that unlike the other local LLMs it is only a 4 bit quantisation so I expected it to perform slightly worse despite it’s higher parameter count. However in the end it was a complete failure at this task.


Sample Output from Sonnet


Sample Output from Qwen


Total Output from Gemma


Summary and Conclusion


Claude Code with Sonnet produces the highest quality documentation of all the models I tested. There is a price and time penalty however. The right local LLM that costs nothing to run and performs quickly is capable of creating accurate and useful documentation with no fuss and drama, and it will run on your (reasonably specced) laptop or desktop.


Local LLMs were considered a joke for real work not so long ago. I’m convinced the future is hybrid, local LLMs for most tasks with cloud models for the really tough stuff. If you’re interested run your own tests and see for yourself. 


Follow up Article


I have written a cross platform chat style application that allows me to switch between cloud and local models and see the difference between their outputs for the type of questions users often type in to ChatGPT or Claude. I can also experiment with pre-loading the prompt with a Speciality or a Personality as well as integrate a Prompt Library and pre-defined Information Layers. I’ll cover the results of these experiments in a future article. You can see the application in the image below.

Databasics: 1 – Primary Keys

There is an ongoing debate among database experts regarding the design of a Primary Key. A debate that in my opinion should have been done and dusted a long time ago.

Note: A Primary Key is a piece of data contained in a database Column that uniquely identifies the database Row. This is the same as how a National Insurance Number uniquely identifies us to the authorities in the UK, or how a soldiers Service Number uniquely identifies then within the Military. If you need to View, Update or Delete an existing database record then it is essential that you can uniquely identify it.

Two Main Schools of Thought

The first says that the Primary Key should be a valid piece of information in it’s own right – not just an identifier. Like a name for example. In the West we use a Surname which identifies us when amongst other people, most of which will hopefully have a different surname. In situations where that is not true, for example family gatherings, the first name can be used as well as a means of narrowing this down. It can be difficult to build up a unique piece of information using valid information.

The second school of thought acknowledges the problems of the above solution and solves these issues by allowing a non meaningful Unique Identifier whose sole purpose is to be able to identify uniquely within any amount of similar items. This is basically what we have with Military Service Numbers and National Insurance Numbers.

My Preference

My preference is with the second school of thought and in fact you can easily adopt this strategy with most Database Engines using the Auto Increment option on the Column. This lets the Database Engine itself take care of generating a Unique, Non Reuseable Identifier.

I always use the first Column of my Database Table as my Primary Key and name it:

pk

Many of my earlier databases used an incrementing number as the primary key, a number that was unique within the table. One particular system used a number that was unique everywhere within the whole database, the theory being that it would make it easy to see the order of inserts across multiple tables. I never found this to be needed however and I never used it again.

One of the downsides of using an incrementing numeric value as a primary key (if this key is used as a foreign keys elsewhere within the database) is if you have to export and reimport data following a database issue.

You also get issues when you are operating data on a remote database in an offline state, that then needs to be reconciled and synchronized back to the main database.

My current way of thinking is that instead of an incrementing numeric value, I would instead use a GUID instead.

Consistency and Structure

All my Database designs use the same structure in order to build consistency, something which is not fully appreciated until you have to work with legacy databases which haven’t been built with consistency, structure or maintainability in mind.

Another example of consistency and structure; the second column of every Database Table I design is always updguid.

This column contains another identifier, however this one changes with every edit or update of the database record. This is used so that I can find out if the data I am viewing on my screen has actually since been updated elsewhere by someone else.

A comparison between the value of the updguid I have in memory and the value of the one stored in the database is all that is needed to determine the validity of the information I am viewing. If the information is stale I have several options I can pursue. This all is part of my Record Locking strategy, covered in another Databasics post soon 🙂

Artificial Intelligence: Badly Named?

It’s often said that it’s all in the name. Naming is extremely important whether variable naming in Software Development or naming a particular technology itself.

Artificial Intelligence or Synthetic Intelligence as it is often called is in my opinion badly named, as the words Artificial or Synthetic imply that the noun Intelligence is achieved, only through a non natural process.

I believe a better name would be Simulated Intelligence, as this implies something that imitates intelligence, rather than achieves it.

I’ve not seen this articulated elsewhere so it might be that many, or most, would disagree. I stand by it however, but until we are able to adequately describe what intelligence actually is, it may well be a moot point.

Cross Platform Development with Xojo

How about a software development environment that lets you create powerful cross platform software for the following platforms:

Windows
macOS
Linux
iOS
Android
Raspberry Pi


What about of it lets you use any (or all) of the first three platforms as your development platform? What about if for the Mac you could create ARM Native applications, or X86-64 Intel versions, or even a Universal binary?

There is such a tool and i’ve been using on and off for nearly 20 years. Xojo has had a couple of name changes over the years and it’s current name means that it’s always easy to find it on Google 🙂

I have in the past used Xojo for creating applications for the Apple App Store, Google Play Store, Commercial macOS and Windows applications as well as custom applications for paying customers. It truly is an incredible tool and just because you haven’t heard of it doesn’t mean it’s not worth knowing. Xojo has been around since 1997 and continues to get stronger with around four releases per year.

I will be writing far more about Xojo in future, but for now you just get a quick introduction 🙂