Skip to main content

Generate and update agent config files from LM Studio models for VS Code Copilot, OpenCode, Pi, and Codex.

Project description

lmstudio-agent-config

CI PyPI License

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-url to 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lmstudio_agent_config-0.1.2.tar.gz (19.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lmstudio_agent_config-0.1.2-py3-none-any.whl (17.6 kB view details)

Uploaded Python 3

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

Hashes for lmstudio_agent_config-0.1.2.tar.gz
Algorithm Hash digest
SHA256 3a67d6e07527c52202042f22a96d95cfceea6bcb3cf5d9811d7b1b7775638dc9
MD5 679059106b003316da93834f95584cc5
BLAKE2b-256 7105c5ced1c48e310923964701b6020eca8bb98c7ae3c846d952ff199d12d890

See more details on using hashes here.

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

Hashes for lmstudio_agent_config-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6bfd425511e49672ef2738278e54ffe93183c2667634f212b8f3064936feb763
MD5 a278af7059a62c70c29eda6ce04c3e02
BLAKE2b-256 7cde16b376e53e9232b16a5bd8b1cc9f64c5c0e79dd747270bf30a80c244f5e1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page