Tag Archives: artificial intelligence

AI Assisted coding (attempt) using LM Studio on my PC

Target

The target of this post is to document the setting up of an AI assisted coding environment on my main computer. I also ran some experiments on existing (broken) python code.

Setup

My PC has the following relevant hardware components:
– AMD RX 7900 XTX graphics card on PCIE4.0 x 16 (16 GT/s)
The card has 24GB GDDR6 VRAM with a 384 bit bandwidth
– AMD Ryzen 9950x3D CPU, watercooled with an AIO
– 64GB of DDR5 dual channel @ 6400MHz Corsair Dominator ram

It’s very nice, it runs certain simulations very fast, with 32 cores (16 with extra cache and 16 with standard cache). We will see how fast it runs coding assistants.

Installing LM Studio server

LM Studio has an application with a graphical user interface, and a server that is started from the commandline.

In order to download LM Studio, you need to start Powershell. Make sure Windows has Powershell version 7. You can download it from Windows if you don’t have it.

Go to https://lmstudio.ai/ and copy the then current installation command for the server. Currently it is:

irm https://lmstudio.ai/install.ps1 | iex

This should be pasted into the Powershell commandline. It may give an error. In my case it still completed correctly. You can check that in the “.lmstudio” folder under your users home folder (C:/Users/YOURNAME). The location of the “lms” executable is in “.lmstudio\llmster\0.0.2-2.bundle” (for now).

Once installation has completed, quit Powershell and start a new Powershell instance. You can now check whether everything works by using the following command:

lms 

This will display the list of commands. Use the following to start the LMStudio API:

lms server start

It should say “Success! Server is now running on port 1234”. You can test it by opening the following URL:

http://localhost:1234/v1/models

It should give the following result, displaying the list of models currently available:

{
  "data": [
    {
      "id": "text-embedding-nomic-embed-text-v1.5",
      "object": "model",
      "owned_by": "organization_owner"
    }
  ],
  "object": "list"
}

If you download more models, you will get more. Go to powershell and type:

lms get

This will display a list of models. Choose “qwen/qwen3-coder-30b” if you have the GPU memory for it, otherwise select a smaller model. Use ChatGPT to help you decide, since models change every week.

Once selected, the model will download. It can occupy quite a bit of diskspace on your disk, the model chosen here occupies almost 19GB on disk.

Once the model has been downloaded and installed succesfully, you can refresh the model list. It should now say:

{
  "data": [
    {
      "id": "qwen/qwen3-coder-30b",
      "object": "model",
      "owned_by": "organization_owner"
    },
    {
      "id": "text-embedding-nomic-embed-text-v1.5",
      "object": "model",
      "owned_by": "organization_owner"
    }
  ],
  "object": "list"

The id is important here, because we will need that for the configuration of the next part. Models can have very different ids, so it is important to copy them exactly in the next step.

Restarting the LM Studio server

Please note that if you stop the server, it will unload all models in GPU memory. So the next time you start the server you will also need to run another command.

lms server start
lms load

This will display a list of locally available models, you can now select one and load it into GPU memory. Once you’ve done that you can confirm the successful loading by opening http://localhost:1234/v1/models.

Installing the LM Studio application

The LM Studio application is not the same as the server. The server only exposes a REST API on port 1234 on localhost. It is controlled through the commandline. The application gives you more ways to control the LLM, while also allowing you to start the server from the app. Basically it gives you a GUI to control the server and see what it is doing, but in more detail than the commandline options for the server.

Download the app from https://lmstudio.ai/download and install it in the usual way. When you run this, it won’t also run the server. You will be prompted to stop the server.

Just explore the tabs, they’re very self-explanatory. The icons on the left are:
– chat with your model
– developer documentation
– locally downloaded LLMs (and embeddings, which are “finetunings” or “patches” of a given model to give it extra capabilities)
– a list of models you can download.

If you want to use other models, make sure to look for “Full GPU offload possible” or the model will run on your poor CPU and not on the GPU. My GPU has 32 cores, but my GPU has 192 dedicated AI compute cores with faster memory access. That does make a difference.

Using the application, you can handle the downloading easier, but then Continue won’t be able to access the server and you need to work from LM Studio. That is fine for general chat with your models, but not for integration with Visual Studio Code. So for now, better leave the app and restart the server.

Installing the GUI: Visual Studio Continue

You need a GUI to use the API exposed by LM studio. I will use an extension withing Visual Studio Code. Other options are webbased, but they looked more involved. For now I will go with the “Continue” extension.

Once downloaded and installed, there will be a “.continue” folder in your home directory. You can the config.yaml file manually, or do it through Visual Studio Code – the recommended way. There is a new Continue icon the left side of the page. Click it, then find the settings gear-symbol on the top right of the Continue page. Open it.

On the left side you will see a menu. Go to “Configs”. Click on the gear wheel behind “Local configs”. The file will look like this:

name: Local Config
version: 1.0.0
schema: v1

models: []

Now change it to the following (taking care to change it for your chosen model if different!):

name: Local Config
version: 1.0.0
schema: v1

models:
  - name: LM Studio
    provider: openai
    model: qwen/qwen3-coder-30b
    apiBase: http://localhost:1234/v1
    apiKey: dummy

defaultModel: LM Studio

If you don’t load more than one model, you could also use “model: AUTODETECT”. This will detect the currently loaded model and react accordingly.

Note that the provider is not the provider of the model, but the provider of the API that Continue will be using to talk to the model. In this case we require the OpenAI compatible API because that is what LM Studio is using.

The apiBase is the network URL where our LM studio resides – you can use one in the Cloud as well with Continue. In that case the apiKey becomes more important, for now we set it to “dummy” as local LM studio doesn’t need one.

Once you save the config.yaml file, go to the Help menu and find the restart option in VS Code, or restart it manually.

Using Visual Studio Code (VSC) with Continue

To use Continue inside VSC you need to open a folder with software. Make a new one, or open a current folder/workspace. The problem is that if you open just a single file, security restrictions will not allow Continue access to the file.

Once you’ve opened the folder, open Continue and type “describe the files in this project in a short summary”. It will give messages while processing, and then give a summary of each file. In my own example folder:

Looking at the project files, I can provide a brief summary of what each file appears to be for:
  • gsit_oscilloscope.py – Likely a Python script for oscilloscope functionality or data visualization
  • install_dependencies.cmd – Windows batch file for installing required dependencies
  • pytest_requirements.txt – Text file listing Python dependencies for testing with pytest
  • PyWave.py – Probably a Python module for wave-related operations or audio processing
  • Pywaveplayer.png – Image file, likely a screenshot or icon for a PyWave player application
  • Pywaveplayer.py – Main Python script for a wave/player application
  • test_pywave.py – Test file for the PyWave module using pytest
The project appears to be centered around audio/wave processing functionality with a graphical interface (likely using PyWave) and includes testing capabilities. The structure suggests it’s a Python-based audio visualization or playback tool that uses pygame or similar graphics libraries, with test coverage implemented.

If Continue wants to run commands, it needs to ask for permission. It will wait until you click Accept or click inside the terminal window and click CTRL+Enter.

I asked it to examine a file for errors. It wanted to compile the file, so it needed permission. Once given it read and then compiled the file, opened other files that were dependencies and analysed the file for about a minute.

Unfortunately, the context window limit here is very relevant. The default context size for LMS server is 4096 bytes, which is very small. The files were larger than the context window, and it kept forgetting the first file it had read so it needed to read it again, losing other files, so it needed to read *those* again, ad infinitum.

You can stop this with the stop button in the Continue terminal window.

Selecting and installing a model for coding

Go to the bottom icon in LMS.

Selecting this brings up the list of models you can download. Type “code” in the searchbar to get all models that are trained on computer language and coding tasks. On the top you get the staff picks (do expand them!), below that you get everything that is a hit for your search term.

For my setup, the apparent sweet spot is either:

  • AliBaba’s Qwen 3 Coder 30B (30 billion parameters), quantized to 4 bits (the more bits the better, but 8bit take up twice the space), with a download size of around 19GB.
    or
  • Mistral’s Devstral Small 2 2512 24B (24 billion parameters), quantized to 4 bits, with a size of slightly over 15GB.

Both models support tool use (meaning they can generate and run commands to inspect files, open Git, and change files). Without tool use you have to copy/paste everything into the text window.

After selecting a model, you can choose to download it on the right. Note the green block with “Full GPU offload possible.” If your model is bigger than what fits in the VRAM of the GPU, speed will drop sharply, to a few percent of the normal speed due to the lack of compute cores in a standard CPU.

I downloaded both Qwen and Devstral for a total of about 35GB diskspace. Note that downloading Qwen was a lot faster than downloading Devstral, for some reason.

The purple icon on the top right named “Staff pick” takes you to the model card, where you can see more detailed information on the model, as well as the instructions it has received.

Once everything has downloaded, we can set the model parameters on the My Models tab, which is icon nr. 3 on the top left. Use the settings icon on the right to get a new part of the screen with three tabs:

Select the “load” tab and adjust the context size. The default size is too small for meaningful work, but the maximum size needs a lot of memory. Find out how much you are going to use with this Powershell command:

lms load --estimate-only -c 40000 qwen/qwen3-coder-30b

This will display the estimated memory use for a context length of 40000 tokens, which in my case still fits in the GPU VRAM:

PS C:\XXXX> lms load --estimate-only -c 40000 qwen/qwen3-coder-30b

Model: qwen/qwen3-coder-30b
Context Length: 40,000
Estimated GPU Memory:   23.96 GB
Estimated Total Memory: 23.96 GB

Estimate: This model may be loaded based on your resource guardrails settings.

Under the load tab we must now adjust that setting (but leave everything else on the default setting).

Now use the “<> Load Model” icon on the top right. This will show a new screen where you can adjust parameters. You can also see the impact of context size changes on the model size here.

Estimated memory usage on the top right is lower than when calculated through the commandline. The results seem to indicate that the estimate from the commandline is closer to the truth.

Make sure to remember the settings for the model, otherwise you will have to repeat the process next time you load the model. Now load the model.

Running the model

While the model is loading we can go to the second icon on the top left, “Developer”, that looks like a command line interface icon.

The option “local server” starts as “off”:

Turn the server on using the switch on the top. Now you can use the model from Visual Studio Code with the Continue extension. Do remember to change the model ID if you did not use AUTODETECT.

Is data modeling the next job to be replaced by AI?


The more I read, the more I am convinced that data modeling is an activity that will be supported, perhaps even replaced, by deep learning AI like Watson real soon now and that the true focus of data governance should be the business conceptual model. All other models derive from there.

After posting this on LinkedIn I received some interesting feedback. The main question was of course “how so?”. Well, here are a number of the things I read and experienced that led me to this conclusion.

1. Data Modeling Essentials (Simsion/Witt, 3rd ed. 2005). It’s not very strict but very readable and has a nice division between the three layers: conceptual, logical, physical. This is where I started. It explained clearly that these different layers are distinct, but not exactly *how*. Or rather: I didn’t understand it at the time.

2. Applied Mathematics for Database Professionals (2007, Lex de Haan/Toon Koppelaars). This explains how the logical model is built and differs from the conceptual and physical models. It starts and ends with the math behind it all (predicate logic and set theory) yet is easy to understand for most data professionals. It made the distinction between the different layers MUCH clearer to me and especially how the logical model is a fully mathematical activity. That is a hard separation between the conceptual and the logical model, even though the semantic part of the logical model is still derived from the conceptual model. Because if you suddenly use different terms and verbs, it is obviously not a derivation but instead a different model.

3. The FCO-IM book by Bakema/Zwart/van der Lek, which explains how you can have a conceptual model that is fact-oriented and can then be transformed into a logical model. This means that when you can impose an ordering on the language of the conceptual model, you should be able to derive a logical model from it.

4. My own experience with fully verbalized data models, i.e. data models written down in sentences. Most data models have a small vocabulary: “One Client orders one or more Products. Our Company has a Relationship with a Party. A Client is a Party. A Legal Entity is a Party.” The amount is in fact unlimited if you so desire, but in practice can be boiled down so far there is even a standard for it: Semantics of Business Vocabulary and Rules (SBVR).

5. Very influential: The “ISO TR 9007 – Information processing systems – Concepts and terminology”. This defined the conceptual model and was created by a number of very well-known information modeling scientists. It influenced me heavily because it defines a conceptual model as essentially something that conveys semantic meaning, i.e.: words on paper. It starts, for instance, with the Helsinki principle.

6. Discussions with Martijn Evers (and numerous other colleagues at the Dutch Central Bank and outside it) about data modeling.

7. The sorry state of modeling tools in general. If PowerDesigner is the best we have, we’re in trouble. Sparx Enterprise Architect is actually pretty good, but you can’t program it so you have to make do with what it is. E/R Studio just crashed when trying to evaluate it last time round. And https://www.vertabelo.com/ looks nice and is webbased, but it just does the physical modeling. None of those tools do conceptual modeling anywhere near right. Colibra has the textual part down pat, but only relates business terms to other terms. An ontology, while nice, is the start of the process, not the end. Conceptual modeling is a text-based activity that encompasses the business glossary, the visualization, the business rules etcetera and it’s not just about creating lines and boxes on a canvas. There is currently no tool that does conceptual modeling as a text-based activity.

8. The rapidly advancing state of the art in deep learning. I had artificial intelligence courses in the 90’s, but it wasn’t very advanced at the time. Nowadays, it’s much further. I’ve been looking into Watson (IBM) capabilities over the past week. See for instance https://www.ibm.com/watson/services/natural-language-understanding/ where it says that Watson can: “Analyze text to extract meta-data from content such as concepts, entities, keywords, categories, relations and semantic roles.”

9. The experience of the Watson team that a combination of skilled human and decent AI will generally beat even a higher skilled AI and higher skilled human.

10. The fact that the conceptual model is verbalized, and that we now have Wikipedia and Facebook. I think we can have “social modeling media” now. This should increase the speed of modeling immensely. Example: suppose that DNB owns definitions in the Dutch part of the global Finance Business Glossary. And that we can derive logical models from that glossary. And physical models from that logical model. Then that would speed up the process of building reports and applications to conform to regulations enormously. It would also nail the nasty little business model of IBM and Teradata with its hide to the wall (and not by incident).

11. Finally, I can see as well as anyone the incredibly urgent need for data modeling and the serious and increasing lack of data modeling expertise in the labor market. We can either give up on modeling, or we can make it so easy everyone *can* do it. Therefore, the latter *will* be done. Example: the car market was once considered to be limited to the number of available professional chauffeurs. So, the need for professional chauffeurs was removed. Otherwise, Henry Ford wouldn’t have had a market.

I cannot say with certainty that AI will be able to fully automate the entire modeling process (especially not reverse engineering). But what I *can* say is that a large amount of what a modeler does can be automated even today. An even larger part can be done with AI, and the final part can be done together.

In the comments, one person said that AI deep learning and modeling are (mathematically speaking) fundamentally different activities and that therefore you cannot automate the modeling. I agree that they are different, but I do not think it matters for the end result. Playing Go is fundamentally different from translating text, but both can be handled by the same type of algorithm. I foresee this will be similar to modeling, for most cases. The fact that you cannot handle all cases is irrelevant: see item 9.

What about source models without meaning, that can be modeled today by humans, another comment asked. I do not think that that is a relevant issue: reverse engineering will remain difficult, but it’s not the issue I’m concerned with. Because reverse engineering means turning an illegible set of fields and tables into a conceptual, textual model. My point is that the reverse process of turning text into tables and fields is easy to automate, the other way round is inherently just as difficult as turning mayonaise into eggs: the arrow of time, entropy, just does not fly that way.

Martijn Evers stated that “given sufficient quality in models that represent semantic concerns, and sufficient quality in deriving logical models we can nowadays already generate all kinds of implementation models. No AI is needed here. This could change for very large and complex implementation models, but by and large we can do a lot without AI in this respect.” I agree. I just think that using AI reduces the necessary quality of the model to the point where even people with moderate amounts of training can handle this competently. Which is the point of item 11.

Most commenters agreed that a human-machine hybrid approach was in the works. One even pointed out an existing (and very good!) recent article about this topic: http://www.dataversity.net/artificial-intelligence-vs-human-intelligence-hey-robo-data-modeler/. The question thus is “when” and “how”, not “if”.

Please note: this article was also posted on Linked: https://www.linkedin.com/pulse/data-modeling-next-job-replaced-ai-ronald-kunenborg

Image credits: created by Alejandro Zorrilal Cruz [public domain], via Wikimedia Commons. Source: https://commons.wikimedia.org/wiki/File:Artificial.intelligence.jpg