Opencode config updater for LM Studio models
  • JavaScript 100%
Find a file
2026-05-06 22:39:07 +03:00
fetch-models.js init 2026-05-06 22:36:27 +03:00
mise.toml init 2026-05-06 22:36:27 +03:00
README.md update docs 2026-05-06 22:39:07 +03:00

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 limits are 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]
    }
  }
}