Local coding assistant with LLMs and VS Code

13th century drawing of computer exploding with code

Here's a quick and dirty setup I'm using for my coding assistant. Keep in mind I have no idea how these things work and I'm learning as I go, so there are probably better resources out there.

I'm lazy and I want to have nice chat GUI to interact with models. Currently I'm using LM Studio, although I'm not fond of it being closed source and I'm probably going to switch to something like Jan AI or just use the most popular web UI.

For my model, I'm using Deepseek Coder. It's pretty good with most of the things I throw at it but one thing to keep in mind with all these models is they are not necessarily always up to date. Here's what Deepseek knows about PHP versions:

And here's ChatGPT 3.5 answer:

As of my last knowledge update in January 2022, the latest stable version of PHP was PHP 8.1. However, it's important to note that software versions can change frequently, and new releases may have occurred since then.

To get the most up-to-date information on the latest version of PHP, I recommend checking the official PHP website (https://www.php.net/) or other reliable sources for the latest announcements and releases.

This is not ideal but new models are getting out faster than new JS frameworks, so it's probably going to get more up to date in the future.

Most of the popular LLM clients have the option of acting as inference server. They usually serve endpoints similar to OpenAI API so they can be drop-in replacement if necessary. This is where our VS Code integration comes in.

For integration with VS Code, I'm using Continue. It was fairly easy to set up, and integration is pretty seamless.

Here are the complete steps:

  1. Install LLM client like LM Studio.

  2. Find and download a model optimized for coding.

  3. Add the model to your client.

  4. Enable API server in the client.

  5. Install Continue in VS Code.

  6. Configure Continue with your provider.

  7. Test to see if everything works.

As a side note, here's my latest prompt:

Q: In javascript, given the following array, how do I extract unique currency:

[ {price: 4, currency: '€'}, {price: 5, currency: 'kn'}, ]

A: You can use Set to extract unique values in JavaScript. Here's an example of how you could do that with your array:

let arr = [
    {price: 4, currency: '€'},
    {price: 5, currency: 'kn'},

// Use map() to create a new array with just the currencies
let currencyArray = arr.map(item => item.currency);

// Convert it into a Set, which will automatically remove any duplicates
let uniqueCurrencySet = new Set(currencyArray);

// Now convert back into an Array using Array.from()
let uniqueCurrencies = Array.from(uniqueCurrencySet);

Now uniqueCurrencies contains the unique currencies from your array:

console.log(uniqueCurrencies); // ['€', 'kn']

This code first maps over the original array to create a new array of just the currencies, then converts that array into a Set (which automatically removes duplicates), and finally converts it back into an Array using Array.from(). The result is an array with all unique currency values.

Find me on