Local ai code assistant

Disclaimer: Because the README file of this project is good, I decided to duplicate it here too.

Build your personal code assistant

This is a personal experiment to explore whether it’s possible to build a local, offline-first code assistant on top of an open-source language model.

The assistant maintains context in a JSON file, which is updated with each interaction — allowing the model to pick up where it left off.

Problem Context

This started because I didn’t want to rely on commercial products like GitHub Copilot, nor be dependent on an internet connection. I wanted something that works even on a train or plane. The second constraint is about my development environment. I’m a Lunarvim user and occasionally use Neovim, so my goal was to first create something pluggable in Lunarvim and then adapt it for use in plain Neovim. The third constraint was focusing on the programming language. I’m mainly Ruby developer and occasionally Python so I’ve started by focusing on these two only.

How it Works (High-level)

Draft Implementation

To make the agent run I had to do two things first:

The first iteration is the get_suggestions.py and ai_assistant.lua. These two work together as follows:

-- Keymap to trigger the AI assistant
lvim.keys.visual_mode["<leader>ai"] = ":<C-U>lua require('ai.ai_assistant').run_code_assistant()<CR>"

The second iteration is more close to what I had in mind and is made up by two other files inline_suggest.lua and get_inline_suggestions.py.

To call this last bit I added to my config the following lines

vim.o.updatetime = 500  -- 500 ms (you can tweak this)
vim.api.nvim_create_autocmd("CursorHold", {
  pattern = { "*" },
  callback = function()
    require("ai.inline_suggest").run()
  end,
})

This creates an auto command that triggers when the cursor is idle for 500ms and interrogates the model.

This is just a basic idea and a work in progress. My hope is to finally have a product that works well enough for my purposes and that can let me use these new technologies without being to0 dependent on the big corporations.

What’s Next


Things I like - in random order

Experimenting with colours:
The image captures a quiet urban scene on a bright day. In the foreground, delicate cherry blossoms frame the view, their pale petals glowing warmly in the light. A white car is parked in an almost empty lot, while a cyclist wearing a helmet rides along a path beside the trees. Behind them, tall buildings rise — a red brick one to the left and a modern glass tower to the right. The sky is striking, a surreal mix of turquoise and violet tones, adding a dreamlike mood. The street is calm, evoking a peaceful, almost cinematic pause in the city.

Experimenting with cinematic style:
A young person in dark clothing crosses a quiet city street beneath a pale, overcast sky. To the left, a brick building marked "BBC Radio Sheffield" stands beside a street sign and a tall clock. Straight ahead, a faded beige building is covered in graffiti, with bare trees and empty benches nearby. Traffic lights show green, but only a few people are visible—two figures walking away on the right pavement, and a few distant cars. The scene feels still and contemplative, with muted colors and cinematic black bars above and below, adding a sense of framing and introspective distance.


Nintendo Switch 2 is the upgrade of my dreams The Guardian

As usual corporate greed is at the base of this race to deploy AI agents:

Make no mistake: We’ve talked to scores of CEOs at companies of various sizes and across many industries. Every single one of them is working furiously to figure out when and how agents or other AI technology can displace human workers at scale. The second these technologies can operate at a human efficacy level, which could be six months to several years from now, companies will shift from humans to machines.

Dario Amodei on the future of AI and the job market Behind the Curtain: A white-collar bloodbath

20 years ago Postcrossing was started. You should get into it, it’s fun!!