Skip to content

OpenCode Desktop shows Context Limit = 0 for LM Studio providers. #35955

Closed as not planned

Description

@newman1976-netizen

Description

LM Studio exposes max_context_length and loaded_context_length via /api/v0/models, but these values are not used by OpenCode. As a result context usage percentage cannot be calculated.

Plugins

No response

OpenCode version

v1.17.15

Steps to reproduce

I'v been using @ai-sdk/openai for lm studio and Responses API

Screenshot and/or share link

Image

Operating System

Windows 10

Terminal

No response

Activity

  1. newman1976-netizen commented on Jul 8, 2026

    @newman1976-netizen
    Author

    LM Studio also has context_length via /api/v1/models.

  2. antag0n1st commented on Jul 15, 2026

    @antag0n1st

    you can something like:

    {
    "$schema": "https://opencode.ai/config.json",
    "disabled_providers": [],
    "plugin": ["@dietrichgebert/ponytail"],
    "provider": {
    "localllm": {
    "name": "Local LLM",
    "npm": "@ai-sdk/openai-compatible",
    "options": {
    "baseURL": "http://192.168.0.57:1234/v1"
    },
    "models": {
    "qwen3.6-27b-mtp": {
    "name": "Qwen 3.6 27b",
    "limit": {
    "context": 226000,
    "output": 65536
    }
    },
    "qwen3.6-27b-mtp@q5_k_m": {
    "name": "Qwen 3.6 27b Q5",
    "limit": {
    "context": 120000,
    "output": 65536
    }
    },
    }
    }
    },
    "shell": "powershell"
    }

    in your opencode.jsonc file C:\Users~USER.config\opencode\opencode.jsonc

  3. github-actions commented on Sep 14, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions