lmstudio-agent-config
lmstudio-agent-config discovers models from LM Studio and generates local
agent configuration for common developer clients.
Supported targets:
About
This tool reads LM Studio’s /api/v1/models endpoint, detects model capabilities, and produces
client-specific configuration. You can print a model list or write config files directly for the
supported targets, with optional filters for context length and capabilities.
Features
- Auto-discover LM Studio models from
/api/v1/models. - Detect tool calling, vision support, and context length.
- Generate configs for VS Code Copilot, OpenCode, Pi, and Codex.
- Preview changes with a focused diff and a confirmation prompt.
- Create dated backups before writing files.
- Filter by minimum context length, tools, and vision support.
How it works
- Queries LM Studio’s local server for available models.
- Builds target-specific configuration payloads.
- Either prints results or updates config files in place.
Safety behavior
When writing files, the tool is intentionally conservative. It prints a focused diff of only the
changed lines, asks for confirmation (y/N), and only then writes the file. Before any modification,
it creates a dated backup next to the original file (for example:
settings.260215-0.backup.json), so you can roll back easily if needed.
Install
Run without install (PyPI):
uvx lmstudio-agent-config --help
Install with pip:
pip install lmstudio-agent-config
From source:
uv tool install .
Requirements
- LM Studio is running.
- The local server is enabled in LM Studio.
- The model listing endpoint is reachable (default:
http://localhost:1234/api/v1/models). - If LM Studio runs on another machine, use
--base-urlto point at that host and port.
Quick start
List discovered models:
lmstudio-agent-config
Write config for one target:
lmstudio-agent-config --settings code
Use a remote LM Studio server:
lmstudio-agent-config --base-url http://LMSTUDIO_HOST:1234/v1
Update all installed targets at once (skips missing default files):
lmstudio-agent-config --settings all
Usage
Use filters to control which models are included:
lmstudio-agent-config --min-context 32768
lmstudio-agent-config --tools
lmstudio-agent-config --no-tools
lmstudio-agent-config --vision
lmstudio-agent-config --no-vision
lmstudio-agent-config --min-context 32768 --tools --vision
Targets and default paths
Use --settings-path to override any default path.
| Target | Flag | Default path |
|---|---|---|
| VS Code | --settings code |
~/Library/Application Support/Code/User/settings.json |
| VS Code Insiders | --settings code-insiders |
~/Library/Application Support/Code - Insiders/User/settings.json |
| OpenCode | --settings opencode |
~/.opencode/opencode.json |
| Pi | --settings pi |
~/.pi/agent/models.json |
| Codex | --settings codex |
~/.codex/config.toml |
Codex profiles
For Codex, the tool also generates one profile per discovered LM Studio model under profiles.*.
Switch models with:
codex --profile lmstudio-your-model
Codex does not show these generated LM Studio profiles in a model picker, so use --profile
explicitly when you want a non-default LM Studio model. The tool does not change top-level
model_provider, so your default provider stays as-is.
Custom base URL
Use a custom LM Studio URL:
lmstudio-agent-config --base-url http://localhost:1234/v1
If LM Studio runs on another machine, you must point --base-url at that host and port.
Contributing
Issues and pull requests are welcome. For local development:
git clone https://github.com/alessandrobologna/lmstudio-agent-config.git
cd lmstudio-agent-config
uv sync --extra dev
uv run pytest
uv run ruff format --check
uv run ruff check
uv run ty check
If you want reproducible dev installs, use uv sync --extra dev --frozen.
License
MIT
Metadata
Release files for lmstudio-agent-config 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| lmstudio_agent_config-0.1.2.tar.gz | 19.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| lmstudio_agent_config-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 36.6 kB
Release files / lmstudio_agent_config-0.1.2.tar.gz
| Download URL | lmstudio_agent_config-0.1.2.tar.gz |
|---|---|
| Size | 19.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3a67d6e07527c52202042f22a96d95cfceea6bcb3cf5d9811d7b1b7775638dc9
|
|
BLAKE2b-256 checksum How to use checksums |
7105c5ced1c48e310923964701b6020eca8bb98c7ae3c846d952ff199d12d890
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / lmstudio_agent_config-0.1.2-py3-none-any.whl
| Download URL | lmstudio_agent_config-0.1.2-py3-none-any.whl |
|---|---|
| Size | 17.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6bfd425511e49672ef2738278e54ffe93183c2667634f212b8f3064936feb763
|
|
BLAKE2b-256 checksum How to use checksums |
7cde16b376e53e9232b16a5bd8b1cc9f64c5c0e79dd747270bf30a80c244f5e1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|