← Back to PRs

#7568: feat(agents): add LM Studio auto-discovery and provider support

by sjseo298 open 2026-02-03 00:25 View on GitHub →
docs agents
This PR adds support for **LM Studio** as a local model provider. ### Changes - **Auto-Discovery:** Automatically detects models served by LM Studio at `http://localhost:1234/v1`. - **Configuration:** Defaults to 32k context window and 8k max tokens. - **Provider:** Adds `buildLMStudioProvider` to `models-config.providers.ts`. - **Documentation:** Adds setup instructions in `docs/providers/lmstudio.md`. - **Testing:** Includes unit tests for provider resolution behavior. This simplifies using local models with OpenClaw without manual config editing. <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> Adds an LM Studio local provider that can be enabled via `LMSTUDIO_API_KEY`/auth profiles and auto-discovers models from the default LM Studio OpenAI-compatible endpoint (`http://127.0.0.1:1234/v1/models`). This wires the provider into implicit provider resolution, extends env var API-key resolution to include `lmstudio`, adds a small unit test asserting the provider is not implicitly enabled without credentials, and introduces user-facing setup docs under `docs/providers/lmstudio.md`. <h3>Confidence Score: 4/5</h3> - This PR looks safe to merge; changes are localized and follow existing provider patterns. - LM Studio support is added via the same implicit-provider/auth mechanisms used for other providers, with network discovery guarded by explicit credential presence and timeouts. Main concerns are testability of discovery (hard-disabled in test env) and a small docs grammar issue; no obvious runtime-breaking logic was found in the reviewed diffs. - src/agents/models-config.providers.ts (discovery behavior in tests) <!-- greptile_other_comments_section --> <sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub> **Context used:** - Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8)) - Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13)) <!-- /greptile_comment -->

Most Similar PRs