lcode-cli 0.15.0__tar.gz → 0.16.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/CHANGELOG.md +15 -1
  2. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/PKG-INFO +3 -3
  3. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/README.md +2 -2
  4. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/docs/bench.md +6 -0
  5. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/docs/configuration.md +6 -1
  6. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/docs/installation.md +5 -0
  7. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/docs/quickstart.md +1 -1
  8. lcode_cli-0.16.0/docs/servers.md +136 -0
  9. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/mkdocs.yml +1 -0
  10. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/pyproject.toml +1 -0
  11. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/src/lcode/__init__.py +1 -1
  12. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/src/lcode/agent.py +2 -1
  13. lcode_cli-0.16.0/src/lcode/backends.py +430 -0
  14. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/src/lcode/bench.py +10 -5
  15. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/src/lcode/cli.py +87 -18
  16. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/src/lcode/codesearch.py +6 -1
  17. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/src/lcode/config.py +17 -0
  18. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/src/lcode/ollama.py +6 -0
  19. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/src/lcode/repl.py +13 -3
  20. lcode_cli-0.16.0/tests/test_backends.py +335 -0
  21. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/.editorconfig +0 -0
  22. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/.github/CODEOWNERS +0 -0
  23. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
  24. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  25. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
  26. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/.github/ISSUE_TEMPLATE/model_request.yml +0 -0
  27. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  28. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/.github/dependabot.yml +0 -0
  29. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/.github/workflows/ci.yml +0 -0
  30. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/.github/workflows/docs.yml +0 -0
  31. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/.github/workflows/release.yml +0 -0
  32. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/.gitignore +0 -0
  33. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/.pre-commit-config.yaml +0 -0
  34. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/AGENTS.md +0 -0
  35. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/CODE_OF_CONDUCT.md +0 -0
  36. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/CONTRIBUTING.md +0 -0
  37. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/LICENSE +0 -0
  38. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/SECURITY.md +0 -0
  39. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/docs/agents.md +0 -0
  40. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/docs/assets/demo.svg +0 -0
  41. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/docs/assets/extra.css +0 -0
  42. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/docs/assets/logo.svg +0 -0
  43. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/docs/assets/social-preview.png +0 -0
  44. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/docs/changelog.md +0 -0
  45. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/docs/commands.md +0 -0
  46. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/docs/contributing.md +0 -0
  47. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/docs/hooks.md +0 -0
  48. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/docs/how-it-works.md +0 -0
  49. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/docs/index.md +0 -0
  50. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/docs/lsp.md +0 -0
  51. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/docs/mcp.md +0 -0
  52. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/docs/memory.md +0 -0
  53. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/docs/models.md +0 -0
  54. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/docs/sandbox.md +0 -0
  55. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/docs/search.md +0 -0
  56. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/docs/troubleshooting.md +0 -0
  57. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/docs/usage.md +0 -0
  58. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/examples/README.md +0 -0
  59. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/examples/commands/review.md +0 -0
  60. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/examples/skills/commit-message/SKILL.md +0 -0
  61. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/examples/skills/commit-message/scripts/staged.sh +0 -0
  62. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/install.sh +0 -0
  63. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/overrides/main.html +0 -0
  64. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/scripts/record_demo.py +0 -0
  65. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/scripts/social-preview.html +0 -0
  66. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/src/lcode/__main__.py +0 -0
  67. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/src/lcode/bench_backend.py +0 -0
  68. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/src/lcode/catalog.py +0 -0
  69. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/src/lcode/checkpoints.py +0 -0
  70. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/src/lcode/context.py +0 -0
  71. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/src/lcode/extensions.py +0 -0
  72. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/src/lcode/frontmatter.py +0 -0
  73. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/src/lcode/hardware.py +0 -0
  74. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/src/lcode/hooks.py +0 -0
  75. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/src/lcode/limits.py +0 -0
  76. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/src/lcode/lsp.py +0 -0
  77. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/src/lcode/mcp/__init__.py +0 -0
  78. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/src/lcode/mcp/auth.py +0 -0
  79. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/src/lcode/mcp/catalog.py +0 -0
  80. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/src/lcode/mcp/catalog.toml +0 -0
  81. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/src/lcode/mcp/client.py +0 -0
  82. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/src/lcode/mcp/commands.py +0 -0
  83. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/src/lcode/mcp/config.py +0 -0
  84. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/src/lcode/mcp/http.py +0 -0
  85. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/src/lcode/mcp/manager.py +0 -0
  86. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/src/lcode/mcp/protocol.py +0 -0
  87. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/src/lcode/mcp/server.py +0 -0
  88. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/src/lcode/mcp/stdio.py +0 -0
  89. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/src/lcode/memory.py +0 -0
  90. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/src/lcode/models.toml +0 -0
  91. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/src/lcode/permissions.py +0 -0
  92. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/src/lcode/planning.py +0 -0
  93. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/src/lcode/render.py +0 -0
  94. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/src/lcode/repomap.py +0 -0
  95. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/src/lcode/sandbox.py +0 -0
  96. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/src/lcode/servers/__init__.py +0 -0
  97. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/src/lcode/servers/encord.py +0 -0
  98. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/src/lcode/servers/valohai.py +0 -0
  99. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/src/lcode/sessions.py +0 -0
  100. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/src/lcode/subagents.py +0 -0
  101. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/src/lcode/tools.py +0 -0
  102. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/src/lcode/vision.py +0 -0
  103. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/src/lcode/web.py +0 -0
  104. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/tests/conftest.py +0 -0
  105. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/tests/fake_lsp_server.py +0 -0
  106. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/tests/fake_mcp_server.py +0 -0
  107. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/tests/test_agent.py +0 -0
  108. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/tests/test_bench.py +0 -0
  109. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/tests/test_catalog.py +0 -0
  110. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/tests/test_checkpoints.py +0 -0
  111. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/tests/test_cli.py +0 -0
  112. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/tests/test_codesearch.py +0 -0
  113. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/tests/test_config.py +0 -0
  114. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/tests/test_context.py +0 -0
  115. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/tests/test_context_picker.py +0 -0
  116. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/tests/test_extensions.py +0 -0
  117. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/tests/test_hooks.py +0 -0
  118. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/tests/test_lsp.py +0 -0
  119. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/tests/test_mcp.py +0 -0
  120. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/tests/test_memory.py +0 -0
  121. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/tests/test_permissions.py +0 -0
  122. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/tests/test_plan_mode.py +0 -0
  123. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/tests/test_repomap.py +0 -0
  124. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/tests/test_sandbox.py +0 -0
  125. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/tests/test_servers.py +0 -0
  126. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/tests/test_sessions.py +0 -0
  127. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/tests/test_subagents.py +0 -0
  128. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/tests/test_tools.py +0 -0
  129. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/tests/test_vision.py +0 -0
  130. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/tests/test_web.py +0 -0
  131. {lcode_cli-0.15.0 → lcode_cli-0.16.0}/uv.lock +0 -0
@@ -6,6 +6,19 @@ All notable changes to lcode are documented here. The format follows
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.16.0] - 2026-10-05
10
+
11
+ ### Added
12
+
13
+ - Other model servers: LM Studio, llama.cpp's llama-server, vLLM, MLX's server, or any other
14
+ server with an OpenAI-compatible API, instead of Ollama. `lcode config set backend lmstudio` (or
15
+ `llama.cpp`, `vllm`, `mlx`, `openai` with `base_url`); a key can come from `LCODE_API_KEY`. Tool
16
+ calls, streaming, reasoning (on and off), images and structured answers work as with Ollama.
17
+ lcode reads the context window from the server, matches the model setting to the models it
18
+ serves, and moves thinking that a server sends as part of the answer out of it. `lcode doctor`,
19
+ `lcode models`, `lcode bench` and `lcode index` work with every backend. See
20
+ [Other model servers](https://nasser1941.github.io/lcode/servers/), with setup for each.
21
+
9
22
  ## [0.15.0] - 2026-10-05
10
23
 
11
24
  ### Added
@@ -385,7 +398,8 @@ First public release.
385
398
  - `AGENTS.md` project instructions and `/init` to generate them.
386
399
  - One-line installer for Linux and macOS.
387
400
 
388
- [Unreleased]: https://github.com/nasser1941/lcode/compare/v0.15.0...HEAD
401
+ [Unreleased]: https://github.com/nasser1941/lcode/compare/v0.16.0...HEAD
402
+ [0.16.0]: https://github.com/nasser1941/lcode/compare/v0.15.0...v0.16.0
389
403
  [0.15.0]: https://github.com/nasser1941/lcode/compare/v0.14.0...v0.15.0
390
404
  [0.14.0]: https://github.com/nasser1941/lcode/compare/v0.13.0...v0.14.0
391
405
  [0.13.0]: https://github.com/nasser1941/lcode/compare/v0.12.0...v0.13.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: lcode-cli
3
- Version: 0.15.0
3
+ Version: 0.16.0
4
4
  Summary: A local-first terminal coding agent powered by open-weight models on your own GPU or Mac, via Ollama.
5
5
  Project-URL: Homepage, https://nasser1941.github.io/lcode/
6
6
  Project-URL: Documentation, https://nasser1941.github.io/lcode/
@@ -102,7 +102,7 @@ through [Ollama](https://ollama.com), and when it needs current information it c
102
102
  session as short notes, saved by the model, by you (`/remember`) or by a quick check at the end
103
103
  of a session. Not whole conversations, and never secrets.
104
104
  - **Bring your own model.** Eight curated open-weight models, all tested end to end, or any Ollama model
105
- with tool calling.
105
+ with tool calling. Or use LM Studio, llama.cpp, vLLM or MLX instead of Ollama.
106
106
  - **MCP servers, ready to go.** Connect Jira and Confluence, GitHub, AWS, Google Drive, Grafana,
107
107
  Google Cloud, Sentry, Linear, Notion, Postgres, Kubernetes, Metabase, Encord, Valohai and more with one command
108
108
  (`lcode mcp add atlassian`), image generation with ComfyUI, or any other MCP server. Browser sign-in (OAuth) is built in.
@@ -208,8 +208,8 @@ fills up. Details: [How it works](https://nasser1941.github.io/lcode/how-it-work
208
208
 
209
209
  See the pinned [Roadmap issue](https://github.com/nasser1941/lcode/issues/10). Next up:
210
210
 
211
- - [More local backends: LM Studio, llama.cpp, vLLM and MLX](https://github.com/nasser1941/lcode/issues/47)
212
211
  - [Git workflow: /commit, /review, /pr and parallel worktrees](https://github.com/nasser1941/lcode/issues/50)
212
+ - [Automation: JSON output, a Python API and a GitHub Action for self-hosted runners](https://github.com/nasser1941/lcode/issues/48)
213
213
  - More models in the catalog, and test reports from your hardware ([report one](https://github.com/nasser1941/lcode/issues/new?template=model_request.yml))
214
214
 
215
215
  ## Contributing
@@ -66,7 +66,7 @@ through [Ollama](https://ollama.com), and when it needs current information it c
66
66
  session as short notes, saved by the model, by you (`/remember`) or by a quick check at the end
67
67
  of a session. Not whole conversations, and never secrets.
68
68
  - **Bring your own model.** Eight curated open-weight models, all tested end to end, or any Ollama model
69
- with tool calling.
69
+ with tool calling. Or use LM Studio, llama.cpp, vLLM or MLX instead of Ollama.
70
70
  - **MCP servers, ready to go.** Connect Jira and Confluence, GitHub, AWS, Google Drive, Grafana,
71
71
  Google Cloud, Sentry, Linear, Notion, Postgres, Kubernetes, Metabase, Encord, Valohai and more with one command
72
72
  (`lcode mcp add atlassian`), image generation with ComfyUI, or any other MCP server. Browser sign-in (OAuth) is built in.
@@ -172,8 +172,8 @@ fills up. Details: [How it works](https://nasser1941.github.io/lcode/how-it-work
172
172
 
173
173
  See the pinned [Roadmap issue](https://github.com/nasser1941/lcode/issues/10). Next up:
174
174
 
175
- - [More local backends: LM Studio, llama.cpp, vLLM and MLX](https://github.com/nasser1941/lcode/issues/47)
176
175
  - [Git workflow: /commit, /review, /pr and parallel worktrees](https://github.com/nasser1941/lcode/issues/50)
176
+ - [Automation: JSON output, a Python API and a GitHub Action for self-hosted runners](https://github.com/nasser1941/lcode/issues/48)
177
177
  - More models in the catalog, and test reports from your hardware ([report one](https://github.com/nasser1941/lcode/issues/new?template=model_request.yml))
178
178
 
179
179
  ## Contributing
@@ -12,6 +12,10 @@ lcode bench --json results.json # also save machine-readable results
12
12
  lcode bench --markdown # also print a table to paste into a test report
13
13
  ```
14
14
 
15
+ `lcode bench` also runs against [other model servers](servers.md), such as llama-server or LM
16
+ Studio: `LCODE_BACKEND=llama.cpp lcode bench`. The server keeps the model loaded and doesn't report
17
+ its memory use, so those columns stay empty.
18
+
15
19
  ```text
16
20
  lcode bench · NVIDIA GeForce RTX 4080 Laptop GPU (12 GB VRAM), 31 GB RAM · Ollama 0.32.15
17
21
 
@@ -158,6 +162,7 @@ existing fields keep their meaning until `schema` changes.
158
162
  "schema": 1,
159
163
  "lcode": "0.3.1",
160
164
  "ollama": "0.32.15",
165
+ "server": "Ollama 0.32.15",
161
166
  "date": "2026-09-30T19:09:09+02:00",
162
167
  "hardware": {
163
168
  "os": "linux", "cpu": "13th Gen Intel(R) Core(TM) i9-13980HX", "ram_gib": 30.96,
@@ -197,6 +202,7 @@ existing fields keep their meaning until `schema` changes.
197
202
 
198
203
  | Field | Meaning |
199
204
  |---|---|
205
+ | `ollama`, `server` | The Ollama version, or `null` with [another model server](servers.md); `server` names the server either way |
200
206
  | `runs[].model` | The name you gave (catalog key or Ollama tag); `ollama_model` is the model that ran |
201
207
  | `runs[].context`, `num_batch`, `think` | The settings used. lcode lowers the batch size or context if the GPU runs out of memory, and reports what it ended up using |
202
208
  | `runs[].memory_gb`, `gpu_percent` | From Ollama's `/api/ps`; `null` if unavailable |
@@ -15,11 +15,13 @@ lcode config path # print the file location
15
15
 
16
16
  | Setting | Default | Meaning |
17
17
  |---|---|---|
18
- | `model` | `qwen3.6-35b` | Catalog key (see `lcode models`) or any installed Ollama model tag |
18
+ | `model` | `qwen3.6-35b` | Catalog key (see `lcode models`) or any installed Ollama model tag; with another [backend](servers.md), a model the server serves |
19
19
  | `context` | largest that fits | Context window in tokens; accepts `128k`, `1m` |
20
20
  | `num_batch` | 512 | Prompt batch size. Larger reads prompts faster but needs more GPU memory |
21
21
  | `keep_alive` | `30m` | How long Ollama keeps the model in memory after the last request |
22
22
  | `ollama_host` | `http://localhost:11434` | Ollama server URL |
23
+ | `backend` | `ollama` | The model server: `ollama`, `lmstudio`, `llama.cpp`, `vllm`, `mlx` or `openai` (any OpenAI-compatible API); see [Other model servers](servers.md) |
24
+ | `base_url` | the backend's | The server's OpenAI-compatible address, e.g. `http://localhost:1234/v1` |
23
25
  | `permission_mode` | `ask` | `ask`, `plan`, `auto-edit` or `yolo` |
24
26
  | `think` | `true` | Let the model reason before answering |
25
27
  | `web` | `on` | Web search and page fetching: `on`, `ask` (before each search/website) or `off` |
@@ -65,6 +67,9 @@ Environment variables override the file, which is useful for one-off runs and CI
65
67
  | `LCODE_NUM_BATCH` | `num_batch` |
66
68
  | `LCODE_KEEP_ALIVE` | `keep_alive` |
67
69
  | `OLLAMA_HOST` | `ollama_host` (same variable the Ollama CLI uses) |
70
+ | `LCODE_BACKEND` | `backend` |
71
+ | `LCODE_BASE_URL` | `base_url` |
72
+ | `LCODE_API_KEY` or `OPENAI_API_KEY` | API key for an [OpenAI-compatible server](servers.md) that needs one (never stored in the config file) |
68
73
  | `LCODE_WEB` | `web` |
69
74
  | `LCODE_SANDBOX` | `sandbox` |
70
75
  | `LCODE_MEMORY` | `memory` |
@@ -151,6 +151,11 @@ lcode config set ollama_host http://gpu-server:11434
151
151
  Your prompts and the code the model reads are then sent to that server. Ollama has no
152
152
  authentication; only expose it on a network you trust (or through an SSH tunnel).
153
153
 
154
+ ### LM Studio, llama.cpp, vLLM or MLX instead of Ollama
155
+
156
+ lcode also works with any server that has an OpenAI-compatible API: `lcode config set backend
157
+ lmstudio` (or `llama.cpp`, `vllm`, `mlx`). See [Other model servers](servers.md).
158
+
154
159
  ### Windows
155
160
 
156
161
  Use [WSL2](https://learn.microsoft.com/windows/wsl/install) with Ubuntu and follow the Ubuntu
@@ -12,7 +12,7 @@ lcode
12
12
 
13
13
  ```text
14
14
  ╭──────────────────────────────────────────────╮
15
- │ lcode v0.15.0 — local coding agent │
15
+ │ lcode v0.16.0 — local coding agent │
16
16
  │ │
17
17
  │ model lcode-qwen3.6-35b │
18
18
  │ context 256K tokens │
@@ -0,0 +1,136 @@
1
+ # Other model servers
2
+
3
+ lcode is built around [Ollama](https://ollama.com), but it also works with any server that has an
4
+ OpenAI-compatible API: [LM Studio](https://lmstudio.ai),
5
+ [llama.cpp](https://github.com/ggml-org/llama.cpp)'s `llama-server`, [vLLM](https://docs.vllm.ai)
6
+ and the [MLX](https://github.com/ml-explore/mlx-lm) server. Tool calls, streaming answers, reasoning
7
+ and all of lcode's tools work the same.
8
+
9
+ ```bash
10
+ lcode config set backend lmstudio # or llama.cpp, vllm, mlx
11
+ lcode doctor # checks the server, the model and its context window
12
+ lcode
13
+ ```
14
+
15
+ | `backend` | Server | Default address |
16
+ |---|---|---|
17
+ | `ollama` (default) | Ollama | `ollama_host`, `http://localhost:11434` |
18
+ | `lmstudio` | LM Studio | `http://localhost:1234/v1` |
19
+ | `llama.cpp` | llama-server | `http://localhost:8080/v1` |
20
+ | `vllm` | vLLM | `http://localhost:8000/v1` |
21
+ | `mlx` | `mlx_lm.server` | `http://localhost:8080/v1` |
22
+ | `openai` | Any other OpenAI-compatible API | Set `base_url` |
23
+
24
+ - **Another address:** `lcode config set base_url http://gpu-box:8000/v1`.
25
+ - **A server that needs a key:** put it in `LCODE_API_KEY` (or `OPENAI_API_KEY`). lcode sends it as a
26
+ bearer token and never writes it to the config file.
27
+ - **For one run:** `LCODE_BACKEND=llama.cpp lcode`.
28
+
29
+ Your prompts and the code the model reads go to that server, so use one you run yourself or trust.
30
+
31
+ ## Choosing the model
32
+
33
+ The `model` setting names a model the server serves. `lcode models` lists them:
34
+
35
+ ```text
36
+ $ lcode models
37
+ Models served by LM Studio at http://localhost:1234/v1
38
+ google/gemma-4-12b
39
+ qwen/qwen3.6-35b-a3b current
40
+ ```
41
+
42
+ Part of the name is enough when only one model matches (`lcode -m gemma`). A server with a single
43
+ model, like llama-server, uses it whatever the setting says. `lcode setup` only installs models
44
+ into Ollama: download models in the server itself.
45
+
46
+ ## The context window
47
+
48
+ With Ollama, lcode chooses the context window and loads the model with it. Other servers load the
49
+ model themselves, with their own window, so lcode reads its size from the server:
50
+
51
+ - llama-server: the `-c` option;
52
+ - vLLM: `--max-model-len`;
53
+ - LM Studio: the context length the model was loaded with.
54
+
55
+ lcode then summarizes the conversation before it outgrows that window. The MLX server and Ollama's
56
+ own OpenAI endpoint don't report a size, so lcode assumes 32K; set the real size with
57
+ `lcode config set context 64k`. A smaller value than the server's is fine (`/ctx 16k`): lcode just
58
+ summarizes sooner.
59
+
60
+ lcode's instructions and tool definitions take about 6K tokens, so give the model at least 32K.
61
+
62
+ ## Setting up each server
63
+
64
+ ### LM Studio
65
+
66
+ 1. Download a model that supports tool use, such as Qwen3.6 35B A3B or Gemma 4.
67
+ 2. Load it with a context length of 32K or more. LM Studio's default of 4K is too small for a
68
+ coding agent.
69
+ 3. Start the server: in the Developer tab, or with `lms server start`.
70
+ 4. Point lcode at it:
71
+
72
+ ```bash
73
+ lcode config set backend lmstudio
74
+ lcode models # the ids LM Studio serves
75
+ lcode config set model qwen/qwen3.6-35b-a3b
76
+ ```
77
+
78
+ On a Mac, LM Studio's MLX models are the fastest route. Load the model before you start lcode: a
79
+ model that LM Studio loads on request gets LM Studio's default context length.
80
+
81
+ ### llama.cpp (llama-server)
82
+
83
+ ```bash
84
+ llama-server -m Qwen3.6-35B-A3B-Q4_K_M.gguf --alias qwen3.6-35b --jinja -c 65536 -ngl 99 --n-cpu-moe 20
85
+ lcode config set backend llama.cpp
86
+ ```
87
+
88
+ - `--jinja` is required for tool calls.
89
+ - `-c` sets the context window, which lcode reads.
90
+ - `--alias` gives the model a short name; otherwise its name is the file's path.
91
+ - On a GPU too small for the whole model, `--n-cpu-moe N` (or `--cpu-moe`) keeps a mixture-of-experts
92
+ model's expert layers in RAM.
93
+
94
+ With Docker and an NVIDIA GPU:
95
+
96
+ ```bash
97
+ docker run -d --gpus all -p 127.0.0.1:8080:8080 -v ~/models:/models ghcr.io/ggml-org/llama.cpp:server-cuda \
98
+ -m /models/Qwen3.6-35B-A3B-Q4_K_M.gguf --alias qwen3.6-35b --jinja -c 65536 -ngl 99 --n-cpu-moe 20 \
99
+ --host 0.0.0.0
100
+ ```
101
+
102
+ ### vLLM
103
+
104
+ ```bash
105
+ vllm serve Qwen/Qwen3-32B --max-model-len 32768 \
106
+ --enable-auto-tool-choice --tool-call-parser hermes --reasoning-parser qwen3
107
+ lcode config set backend vllm
108
+ ```
109
+
110
+ vLLM needs `--enable-auto-tool-choice` and the tool-call parser for the model's family (see vLLM's
111
+ [tool calling](https://docs.vllm.ai/en/latest/features/tool_calling.html) page). A reasoning parser
112
+ keeps the model's thinking out of its answers.
113
+
114
+ ### MLX (Apple silicon)
115
+
116
+ ```bash
117
+ pip install mlx-lm
118
+ mlx_lm.server --model mlx-community/Qwen3-30B-A3B-4bit
119
+ lcode config set backend mlx
120
+ lcode config set context 32k
121
+ ```
122
+
123
+ ## What's different from Ollama
124
+
125
+ | | Ollama | Other servers |
126
+ |---|---|---|
127
+ | Context window | lcode chooses it, and falls back to a smaller one when the GPU runs out of memory | The server's; lcode reads it |
128
+ | Reasoning on and off (`/think`, `--no-think`) | Yes | Yes, for models whose chat template has a switch (Qwen and others) on llama-server and vLLM |
129
+ | Thinking shown separately | Yes | Yes. When a server sends the thinking as part of the answer, lcode moves it out |
130
+ | Images | The model's own vision, or `vision_model` | Set `vision_model` to a model the server serves that can see images |
131
+ | [Code search](search.md#semantic-code-search) | Any installed embedding model | Needs the server to serve an embedding model too, as LM Studio can |
132
+ | Freeing the GPU for MCP tools that need it | Yes | No: the server decides what stays loaded |
133
+ | `lcode bench` memory columns | Measured | Empty: the server doesn't report them |
134
+
135
+ `lcode bench` works the same way with any backend, so you can compare the same model on two
136
+ servers: `LCODE_BACKEND=llama.cpp lcode bench`.
@@ -98,6 +98,7 @@ nav:
98
98
  - Code intelligence: lsp.md
99
99
  - Repository map and code search: search.md
100
100
  - Models & context windows: models.md
101
+ - Other model servers: servers.md
101
102
  - Benchmarking models: bench.md
102
103
  - MCP servers: mcp.md
103
104
  - Sandbox: sandbox.md
@@ -83,6 +83,7 @@ ignore = [
83
83
  "src/lcode/repomap.py" = ["E501"]
84
84
  "src/lcode/codesearch.py" = ["E501"]
85
85
  "src/lcode/bench_backend.py" = ["E501"]
86
+ "src/lcode/backends.py" = ["E501"]
86
87
 
87
88
  [tool.pytest.ini_options]
88
89
  testpaths = ["tests"]
@@ -1,3 +1,3 @@
1
1
  """lcode — a local-first terminal coding agent powered by open-weight models via Ollama."""
2
2
 
3
- __version__ = "0.15.0"
3
+ __version__ = "0.16.0"
@@ -570,7 +570,8 @@ class Agent:
570
570
  self.console.print(f"[dim]{self.settings.model} does not support reasoning; continuing without.[/]")
571
571
  yield from self.chat(messages, tools, False)
572
572
  return
573
- if any(marker in error for marker in GPU_MEMORY_ERRORS):
573
+ # Only Ollama loads the model with lcode's settings; other servers manage their own memory.
574
+ if getattr(self.ollama, "kind", "ollama") == "ollama" and any(m in error for m in GPU_MEMORY_ERRORS):
574
575
  batch = self.settings.num_batch
575
576
  if not started and batch and batch > SAFE_NUM_BATCH:
576
577
  # Larger batches read prompts faster but need extra VRAM that isn't always free.