Opencode config updater for LM Studio models
- JavaScript 100%
| fetch-models.js | ||
| mise.toml | ||
| README.md | ||
Opencode LM Studio Updater
A tool for fetching and configuring models from local servers (e.g., LM Studio) to enable opencode integration.
This script fetches model configuration data from a local server and generates an OpenAI-compatible configuration for use with opencode.
Features
- Dynamically loads model limits from JSON response.
- Supports fallback values if
limitsare missing in the model data. - Outputs structured configuration for LM Studio models.
Usage
Install dependencies and update opencode:
mise install && mise run update-opencode
Configuration
The script fetches data from http://127.0.0.1:1234/v1/models. Ensure this endpoint is accessible and returns valid JSON.
Output
Generates a configuration object in the format:
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"lmstudio": {
"name": "LM Studio (local)",
"models": [model configurations]
}
}
}