Lens chat: allow an OpenAI-compatible endpoint (Ollama / llama.cpp / vLLM) instead of in-browser models
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- ollama
- 領域
- ai, backend-api-design
調査の方向性
Read the existing Lens local agent panel, the OpenAI-style chat call, daemon configuration and route handling, and the legacy llm/start.sh sidecar path. Trace how the UI sends chat requests and how daemon settings are stored before choosing an endpoint flow. Done means an opt-in endpoint setting supports a base URL, model, and optional API key, with the daemon forwarding chat requests and the panel exposing the choice.
索引モデルが issue の本文から書いたものです。
説明
What problem does this solve?
CBM Lens's "Chat with your codebase locally" runs small ONNX models inside the browser (Qwen2.5-Coder 0.5B, Qwen3 0.6B, Qwen3.5 2B, ... fetched from Hugging Face, WebGPU with shader-f16). For people who self-host the MCP server, that leaves a gap:
- Many of us already run a local model server (Ollama, llama.cpp
llama-server, vLLM, LM Studio) with models far larger and better than a 0.5B-2B browser model. Lens cannot use them, so it asks to download its own copy (about 567 MB for the default) per browser, per device, and the cache is not shared. - When Lens is served from a headless box or container and opened from another machine or a phone, the browser model is the weakest possible setup: no WebGPU on many devices, and the model is downloaded again on each one.
- The bundle already has the plumbing for an OpenAI-style chat call (
POST {origin}/v1/chat/completions, withchat_template_kwargsand an optionalmodel), but as far as I can tell it is the "legacy sidecar": fixed at127.0.0.1:4141in the viewer's browser, expecting a hand-started llama.cpp server (llm/start.sh), and documented as "not the active browser agent". There is no setting for pointing it somewhere else.
Context: I run codebase-memory-mcp v0.12.1 in a container on a home server (MCP over a stdio-to-HTTP bridge, Lens behind a reverse proxy on a private network). Anyone self-hosting the graph is likely to self-host models too.
Proposed solution
An optional, explicit "Model endpoint" setting for the Lens agent, off by default:
- base URL (OpenAI-compatible, e.g.
http://ollama:11434/v1), model name, optional API key; - stored in the daemon config (e.g.
config set llm_endpoint ...) and shown in the existing "Local agent" panel as a second choice next to the in-browser models.
Preferably the daemon makes the request (the UI posts to a daemon route and the daemon forwards to the configured endpoint), not the browser. That avoids CORS, avoids mixed-content blocking when Lens is served over HTTPS, keeps any API key out of the browser, and works when the model server is reachable from the daemon but not from the viewer. The existing guarantees can stay as they are: nothing is sent unless the endpoint is configured and the agent is on, the "rewrite guard" still drops claims the source does not show, and the panel can state plainly when the endpoint is not loopback.
Alternatives considered
- Keep the in-browser models and just use them. Works, but the 0.5B-2B models are modest, are downloaded per browser, and do not run well on phones or machines without WebGPU.
- Use the legacy sidecar (
127.0.0.1:4141). Only reaches the viewer's own loopback, so it does not work for a server-hosted Lens, and it is marked legacy. - Ask an MCP client (Claude Code etc.) instead of Lens chat. That is what I do for deep questions; this request is only about making Lens's built-in explanations usable with models people already host.
Happy to test a build against Ollama and llama.cpp.
Confirmations
- I searched existing issues and this is not a duplicate. (Searched for Ollama, OpenAI-compatible, local model endpoint, Lens chat, llama.cpp sidecar, external model.)
- 主要言語
- C
- スター
- 45.8k
- フォーク
- 3.8k
- 平均マージ
- 3日 4時間
- マージ済み PR(30日)
- 208
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
DeusData/codebase-memory-mcp のほかの issue
-
bug editor/integration
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
DeusData/codebase-memory-mcp#2787 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
editor/integration parsing/quality
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
DeusData/codebase-memory-mcp#2286 ·
メンテナーはふだん 2 日以内に返信
-
install writes an unsupported `args` key into the Claude Code SubagentStart hook, so it never runsオープンbug editor/integration priority/high stability/performance ux/behavior
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
DeusData/codebase-memory-mcp#2239 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
bug priority/high ux/behavior
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
DeusData/codebase-memory-mcp#2232 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
-
documentation editor/integration parsing/quality priority/normal
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
DeusData/codebase-memory-mcp#2169 ·
メンテナーはふだん 2 日以内に返信
DeusData/codebase-memory-mcp の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
HexaCluster/credcheck#86 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
mongodb/winkerberos#175 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
AOMediaCodec/SVT-AV1#3320 ·
-
difficulty: easy
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100