Skip to content

AI: LM Studio using default context length instead of what's specified in Zed's settings.json #33938

Description

@mspinelli

Summary

LM Studio using default context length instead of what's specified in Zed's settings.json

Description

Steps to trigger the problem:

  1. Download this model and add to Zed's settings:
    "lmstudio": {
      "api_url": "http://localhost:1234/v1",
      "available_models": [
        {
          "name": "devstral-small-2505-mlx",
          "display_name": "Devstral 60k Q6",
          "supports_tool_calls": true,
          "supports_images": false,
          "max_tokens": 30000
        }
      ]
    },
  1. Ensure LM Studio Server is running
  2. Try and send a message to devstral
  3. Check:
➜ curl http://localhost:1234/api/v0/models
{
  "data": [
    {
      "id": "devstral-small-2505-mlx",
      "object": "model",
      "type": "llm",
      "publisher": "lmstudio-community",
      "arch": "mistral",
      "compatibility_type": "mlx",
      "quantization": "6bit",
      "state": "loading",
      "max_context_length": 131072,
      "loaded_context_length": 4096
    },

Expected Behavior:
It works and for loaded_context_length to be: 30000

Actual Behavior:
loaded_context_length is 4096

And zed returns this message:

Error interacting with language model
Unable to parse chat completions response
invalid type: string "The number of tokens to keep from the initial prompt is greater than the context length.", expected struct ResponseStreamEvent at line 1 column 90

NOTE: If I set the default for this model in LM Studio to be large enough, it works as a workaround, but I would expect that zed overrides the default set.

Model Provider Details

  • Provider: LM Studio
  • Model Name: devstral-small-2505-mlx 6-bit
  • Mode: Agent Panel
  • Other Details: LM Studio 0.3.17 (Build 11)

Zed Version and System Specs

Zed: v0.193.3 (Zed)
OS: macOS 15.5.0
Memory: 48 GiB
Architecture: aarch64

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:aiRelated to Agent Panel, Edit Prediction, Copilot, or other AI featuresarea:ai/lmstudiolmstudio providerarea:ai/ollamaIssues when using models through Ollama.area:settingsFeedback for preferences, configuration, etcreach:some usersBugs that happen for less than one-third of users, special configurations, rare circumstances, etcseverity:S2Average run-of-the-mill bugs; a feature is broken but only partiallystaleLabel used by `stale` actionstate:needs reproNeeds reproduction steps and/or someone to reproduce

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions