feat(claude-vllm): own config file instead of reading opencode's
claude-vllm read `~/.config/opencode/opencode.jsonc` directly. Same shape is
useful; sharing the actual file is not — a credential rotation in opencode would
silently change what Claude Code authenticates with, and it couples two tools'
configs for no reason.
It now has its own `$XDG_CONFIG_HOME/mcpctl/claude-vllm.jsonc`, shaped like
opencode's (`provider.<name>.options.{baseURL,apiKey}` plus a `models` map), and
takes priority. The pi and prime-agent homes stay as a fallback so the command
works before any config exists; reading opencode's file is dropped.
No key is stored in the tool. `apiKey` may be a literal in the 0600 file,
`${ENV_VAR}`, or a bare env var NAME (the form pi's models.json already uses),
so the secret can live in the environment instead of on disk. `--init` reads it
from stdin when `--api-key` is omitted — keeping it out of shell history and out
of the process table, where an argument is visible to every user via `ps`.
`--list` prints at most a 10-character prefix.
`--init` records the context window for every model it can see, not just the
active one: recording only the default meant `--model something-else` silently
fell back to Claude Code's assumed 200k on a 393k model.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BVwuCjuMoA13gmzYEfcrNP
This commit is contained in:
10
README.md
10
README.md
@@ -258,15 +258,17 @@ The homelab gateway (LiteLLM in front of vLLM) already serves the Anthropic
|
||||
Messages API, so Claude Code can talk to it directly — no bridge:
|
||||
|
||||
```bash
|
||||
claude-vllm # reuse the provider/model/key pi or prime-agent already uses
|
||||
claude-vllm --init # write ~/.config/mcpctl/claude-vllm.jsonc (0600)
|
||||
claude-vllm # use it
|
||||
claude-vllm --model deepseek-v4-max
|
||||
claude-vllm --list # show what it would use
|
||||
claude-vllm -- -p "summarise this repo" # args after -- go to claude
|
||||
```
|
||||
|
||||
It discovers the endpoint, credential, model and context window from
|
||||
`~/.pi/agent`, `~/.prime/agent` or opencode's config (first hit wins) and sets
|
||||
the `ANTHROPIC_*` environment Claude Code needs.
|
||||
It reads its own config (shaped like `opencode.jsonc`, but a separate file),
|
||||
falling back to `~/.pi/agent` or `~/.prime/agent` so it works before you have
|
||||
written one. The key may be a literal in the 0600 file, `${ENV_VAR}`, or an env
|
||||
var name — it is never stored in the tool.
|
||||
|
||||
See [docs/claude-vllm.md](docs/claude-vllm.md), including why routing this
|
||||
through mcpctl would add surface without adding capability.
|
||||
|
||||
Reference in New Issue
Block a user