Skip to main content

lcode logo

lcode

A coding agent that runs entirely on your own machine.
Open-weight models · up to 256K tokens of context · your NVIDIA GPU or Apple Silicon Mac · no API keys, no cloud

CI Docs MIT License Python 3.10+ Linux and macOS

Documentation · Install · Models · Contributing

lcode finding and fixing a bug, then running the tests

Point lcode at a repository and talk to it in your terminal. It explores the code, answers questions with file:line references, writes and edits files, runs your scripts and tests, and keeps going until the task is done, asking before it changes anything. The model runs locally through Ollama, so your code never leaves your machine.

Features

  • A real agent. Reads, searches, edits and runs commands in a loop, checks its own work, and plans multi-step tasks with a visible todo list.
  • Long context. 256K tokens with the default model (1M with Nemotron). You choose the window.
  • Hardware-aware. Detects your NVIDIA GPU or Apple Silicon Mac and picks the best model and the largest context that fits: lcode setup does it in one step.
  • Safe by default. Every edit is shown as a diff and every command that isn't read-only needs your approval. auto-edit and yolo modes when you want speed.
  • Bring your own model. Eight curated open-weight models, or any Ollama model with tool calling.
  • Private. No telemetry, no accounts, no API keys.

Install

Ubuntu / Linux (NVIDIA GPU recommended) and macOS on Apple Silicon (M1–M4):

curl -fsSL https://nasser1941.github.io/lcode/install.sh | bash

The installer sets up lcode with its own Python via uv, checks for Ollama (0.30+) and runs lcode setup, which picks a model for your hardware and downloads it. Prefer manual steps? See the installation guide, or:

uv tool install git+https://github.com/nasser1941/lcode
lcode setup

Quickstart

cd ~/code/your-project
lcode
❯ /init                                   # study the repo and write AGENTS.md for future sessions
❯ How does authentication work here? Cite files.
❯ Write scripts/dedupe.py that removes duplicate rows from @data/users.csv by email, and run it
❯ The tests in tests/test_parser.py fail. Find out why and fix it.
lcode -p "…" one request, no interaction (scripts, hooks)
lcode -c continue the last session in this directory
lcode --model qwen3.5-9b --context 128k pick a model and context window for this session
lcode models / lcode doctor what fits this machine / check the installation
/model, /ctx 128k, /compact, /help switch model, resize context, summarize, list commands

Models

Key Model Download Max context
qwen3.6-35b Qwen3.6 35B-A3B Coding (MoE, 3B active) 22.6 GB 256K default, tested
qwen3.8-27b Qwen3.8 27B (dense) 17.7 GB 256K
qwen3.6-27b Qwen3.6 27B Coding (dense) 17.8 GB 256K
laguna-xs-2.1 Poolside Laguna XS 2.1 (MoE, 3B active) 20.3 GB 256K
nemotron-3.5-lightning NVIDIA Nemotron 3.5 Lightning (hybrid MoE) 25.4 GB 1M
gpt-oss-20b OpenAI gpt-oss 20B (MoE) 13.8 GB 128K
qwen3.5-9b Qwen3.5 9B (dense) 6.6 GB 256K tested
qwen3.5-4b Qwen3.5 4B (dense) 3.4 GB 256K tested

What lcode setup picks for common machines:

Machine Model Context
Mac with M4, 16 GB qwen3.5-9b 64K
Mac with M4 / M4 Pro, 24 GB qwen3.5-9b 256K
Mac with M4 Pro / M4 Max, 36 GB qwen3.6-35b 64K
Mac with M4 Pro, 48 GB · M4 Max, 64 GB+ qwen3.6-35b 256K
NVIDIA 8–24 GB + 32 GB RAM qwen3.6-35b 256K
NVIDIA 8 GB + 16 GB RAM qwen3.5-4b 64K

On an RTX 4080 Laptop GPU (12 GB) the default model generates 50–60 tokens/s at 256K context, and qwen3.5-9b 64 tokens/s at 128K. See Models & context windows for memory estimates and tuning.

How it works

lcode sends your request, the repository layout and a set of tool definitions to the model; runs the tools the model calls (read, edit, grep, glob, bash, todo); feeds the results back; and repeats until the model answers. It sizes models to your memory from each model's KV-cache footprint, uses text-only model variants to free GPU memory, and summarizes the conversation when the context window fills up. Details: How it works.

Roadmap

  • More models in the catalog, with community test reports (request one)
  • Measured Apple Silicon performance numbers
  • MCP (Model Context Protocol) tool servers
  • Web fetch and search tools
  • Packaging on PyPI and Homebrew

Contributing

Contributions are welcome: bug reports, model test results, docs and code. See CONTRIBUTING.md. Please follow the code of conduct, and report security issues privately as described in SECURITY.md.

Acknowledgements

lcode stands on Ollama and llama.cpp, the open-weight models from Qwen, Poolside, NVIDIA and OpenAI, Rich and prompt_toolkit.

License

MIT © 2026 Naser Derakhshan

Metadata

Release files for lcode-cli 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lcode-cli 0.1.1
File Size Uploaded
lcode_cli-0.1.1.tar.gz 573.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lcode-cli 0.1.1
File Interpreter ABI Platform
lcode_cli-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 614.7 kB

Release files / lcode_cli-0.1.1.tar.gz

Download URL lcode_cli-0.1.1.tar.gz
Size 573.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b964e4266fbbbac7f09b9822519c8c7a37a7b5d8a3078b1529c17761efb6ce0c
BLAKE2b-256 checksum
How to use checksums
caa9bf31ca7a6e2f06e3a80676fe4075c03366f8e0a3231f28e2fdb27f052d87
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / lcode_cli-0.1.1-py3-none-any.whl

Download URL lcode_cli-0.1.1-py3-none-any.whl
Size 41.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aac301e41de056bd5abbf3c7b8636f7445c70e0153c27687eacaa226bde9d29a
BLAKE2b-256 checksum
How to use checksums
e5ca7a6f3dac36a92513eef6b4c7aba29f16225741ef4fea6cd0e264c7deda4e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

0.6.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.2

2 release files

This release

0.1.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page