Generate and update agent config files from LM Studio models for VS Code Copilot, OpenCode, Pi, and Codex.
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lmstudio_agent_config-0.1.2.tar.gz.
File metadata
- Download URL: lmstudio_agent_config-0.1.2.tar.gz
- Upload date:
- Size: 19.0 kB
- Tags: Source
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a67d6e07527c52202042f22a96d95cfceea6bcb3cf5d9811d7b1b7775638dc9
|
|
| MD5 |
679059106b003316da93834f95584cc5
|
|
| BLAKE2b-256 |
7105c5ced1c48e310923964701b6020eca8bb98c7ae3c846d952ff199d12d890
|
File details
Details for the file lmstudio_agent_config-0.1.2-py3-none-any.whl.
File metadata
- Download URL: lmstudio_agent_config-0.1.2-py3-none-any.whl
- Upload date:
- Size: 17.6 kB
- Tags: Python 3
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6bfd425511e49672ef2738278e54ffe93183c2667634f212b8f3064936feb763
|
|
| MD5 |
a278af7059a62c70c29eda6ce04c3e02
|
|
| BLAKE2b-256 |
7cde16b376e53e9232b16a5bd8b1cc9f64c5c0e79dd747270bf30a80c244f5e1
|