Repository navigation
Agent: LM Studio as a local model; remove the Claude Code mode - #38
Merged
Merged
Conversation
LM Studio (0.4.1+) answers the Anthropic Messages API at /v1/messages, so the Agent drives it with the same loop, tools and approvals as Ollama: plain headers only, the fields a local server reads. The drawer lists the server's language models from /api/v1/models, those trained for tool use first, with each loaded copy's context, picks one with room for the Agent's ~15k-token instructions, and says how to reload with 32k. Errors name the CORS switch, the version, a context overflow and a server that wants a token. The Claude Code mode is gone with its materia-live MCP bridge, scripts and .mcp.json entry; the materia MCP server is unchanged. The Agent now starts on the user's own API key, and a saved Claude Code choice falls back to it. With one sender left, tool calls no longer carry a source. Shared local-server helpers (plainFetch, the context floor) move to localServer.ts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MReUfYLPkA6mqDmVQK5NpM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
LM Studio as a fourth way to reach a model. LM Studio 0.4.1+ answers the Anthropic Messages API at
/v1/messages, so the Agent drives it with the same chat loop, tools, approval cards and undo as Ollama. It sends only plain headers and only the request fields a local server reads./api/v1/models, those trained for tool use first, each with the context its loaded copy was given.lms load <model> --context-length 32768).The Claude Code mode is removed, together with the
materia-liveMCP bridge (src/agent/bridge/,bridgeClient.ts),scripts/live-bridge-demo.mjs, themcp:live/build:mcp-livescripts and its.mcp.jsonentry.materiaMCP server is unchanged.source.Shared local-server helpers (
plainFetch, the 32k context floor) move tosrc/agent/localServer.ts.Docs:
docs/AGENT_TOOLS.md(modes table, LM Studio, a plain explanation of the local proxy),docs/ROADMAP.md,CHANGELOG.md(Unreleased).Testing
npm run typecheck,npm run lint,npm run build, andnode scripts/build-mcp.mjsall pass.lmstudio.test.ts: model listing against a stand-in server in LM Studio's documented shape, plus the too-old and not-LM-Studio cases.chat.test.ts: LM Studio request headers and fields, the Ollama → LM Studio history switch, and error messages.useAgent.test.ts: migrating stored settings from Claude Code.claude-codesetting migrated to API key;get_stateand answered, sending nox-api-key,anthropic-*orauthorizationheaders;🤖 Generated with Claude Code
https://claude.ai/code/session_01MReUfYLPkA6mqDmVQK5NpM
Generated by Claude Code