Skip to content

[Bug]: LlamaCpp and LmStudio login fails to get models #3507

Closed as not planned

Description

@imrehg

Bug Description

When logging in with either LlamaCpp or LmStudio providers, forge connects to the backend, but fails to parse the returned model list, due to an apparent schema error.

Steps to Reproduce

  1. Run /model
  2. Select either LlamaCpp or LmStudio as a provider; either set it up at the first time, or try to select a model if it was already set up
  3. forge tries to connect to the provider as OpenAI compatible, but fails

Expected Behavior

Model list is correctly parsed (since I can see in the server logs that the data is returned).

Actual Behavior

I'm getting errors like:

● [22:02:09] ERROR: Failed to fetch models from OpenAI-compatible provider

Caused by:
    0: Failed to deserialize models response
    1: GET http://127.0.0.1:8080/v1/models
    2: missing field `modality` at line 1 column 668

I'm using LMStudio 0.4.16 (Build 2) and llama-server version: 9601 (2c00efc).

An actual LlamaCpp models endpoint response
{
  "data": [
    {
      "id": "GLM-4.7-Flash-GGUF",
      "aliases": [],
      "tags": [],
      "object": "model",
      "owned_by": "llamacpp",
      "created": 1781360984,
      "status": {
        "value": "unloaded",
        "args": [
          "/usr/bin/llama-server",
          "--host",
          "127.0.0.1",
          "--port",
          "0",
          "--ui-mcp-proxy",
          "--alias",
          "GLM-4.7-Flash-GGUF",
          "--ctx-size",
          "135000",
          "--model",
          "/home/greg/.lmstudio/models/lmstudio-community/GLM-4.7-Flash-GGUF/GLM-4.7-Flash-Q4_K_M.gguf",
          "--parallel",
          "1"
        ],
        "preset": "[GLM-4.7-Flash-GGUF]\nui-mcp-proxy = 1\nctx-size = 135000\nmodel = /home/greg/.lmstudio/models/lmstudio-community/GLM-4.7-Flash-GGUF/GLM-4.7-Flash-Q4_K_M.gguf\nparallel = 1\n\n"
      },
      "architecture": {
        "input_modalities": [
          "text"
        ],
        "output_modalities": [
          "text"
        ]
      },
      "need_download": false
    },
    {
      "id": "Qwen3.6-35B-A3B-GGUF",
      "aliases": [],
      "tags": [],
      "object": "model",
      "owned_by": "llamacpp",
      "created": 1781360984,
      "status": {
        "value": "loaded",
        "args": [
          "/usr/bin/llama-server",
          "--host",
          "127.0.0.1",
          "--port",
          "49759",
          "--ui-mcp-proxy",
          "--alias",
          "Qwen3.6-35B-A3B-GGUF",
          "--ctx-size",
          "135000",
          "--model",
          "/home/greg/.lmstudio/models/lmstudio-community/Qwen3.6-35B-A3B-GGUF/Qwen3.6-35B-A3B-Q8_0.gguf",
          "--mmproj",
          "/home/greg/.lmstudio/models/lmstudio-community/Qwen3.6-35B-A3B-GGUF/mmproj-Qwen3.6-35B-A3B-BF16.gguf",
          "--parallel",
          "1"
        ],
        "preset": "[Qwen3.6-35B-A3B-GGUF]\nui-mcp-proxy = 1\nctx-size = 135000\nmodel = /home/greg/.lmstudio/models/lmstudio-community/Qwen3.6-35B-A3B-GGUF/Qwen3.6-35B-A3B-Q8_0.gguf\nmmproj = /home/greg/.lmstudio/models/lmstudio-community/Qwen3.6-35B-A3B-GGUF/mmproj-Qwen3.6-35B-A3B-BF16.gguf\nparallel = 1\n\n"
      },
      "architecture": {
        "input_modalities": [
          "text",
          "image"
        ],
        "output_modalities": [
          "text"
        ]
      },
      "need_download": false,
      "meta": {
        "vocab_type": 2,
        "n_vocab": 248320,
        "n_ctx": 135168,
        "n_ctx_train": 262144,
        "n_embd": 2048,
        "n_params": 34660610688,
        "size": 36892150272
      }
    }
  ],
  "object": "list"
}
An actual LMStudio models endpoint response
{
  "data": [
    {
      "id": "nvidia/nemotron-3-nano-omni",
      "object": "model",
      "owned_by": "organization_owner"
    },
    {
      "id": "qwen/qwen3.6-35b-a3b",
      "object": "model",
      "owned_by": "organization_owner"
    },
    {
      "id": "glm-4.7-flash@q8_0",
      "object": "model",
      "owned_by": "organization_owner"
    },
    {
      "id": "text-embedding-nomic-embed-text-v1.5",
      "object": "model",
      "owned_by": "organization_owner"
    }
  ],
  "object": "list"
}

Forge Version

2.13.6

Operating System & Version

Archlinux (rolling)

AI Provider

OpenAI-compatible

Model

N/A

Installation Method

Built from source

Configuration

Default settings, haven't changed anything yet.

Activity

  1. github-actions commented on Jul 13, 2026

    @github-actions

    Action required: Issue inactive for 30 days.
    Status update or closure in 7 days.

  2. added
    state: inactiveNo current action needed/possible; issue fixed, out of scope, or superseded.
    on Jul 13, 2026
  3. 0chroma commented on Jul 13, 2026

    @0chroma

    still an issue. There was a PR but it got auto-closed even though it was approved.

  4. removed
    state: inactiveNo current action needed/possible; issue fixed, out of scope, or superseded.
    on Jul 13, 2026
  5. github-actions commented on Aug 12, 2026

    @github-actions

    Action required: Issue inactive for 30 days.
    Status update or closure in 7 days.

  6. added
    state: inactiveNo current action needed/possible; issue fixed, out of scope, or superseded.
    on Aug 12, 2026
  7. 0chroma commented on Aug 13, 2026

    @0chroma

    not inactive

  8. removed
    state: inactiveNo current action needed/possible; issue fixed, out of scope, or superseded.
    on Aug 13, 2026
  9. github-actions commented on Sep 12, 2026

    @github-actions

    Action required: Issue inactive for 30 days.
    Status update or closure in 7 days.

  10. added
    state: inactiveNo current action needed/possible; issue fixed, out of scope, or superseded.
    on Sep 12, 2026
  11. imrehg commented on Sep 12, 2026

    @imrehg
    Author

    Beep-bop. Commenting to keep alive.

  12. removed
    state: inactiveNo current action needed/possible; issue fixed, out of scope, or superseded.
    on Sep 12, 2026
  13. amitksingh1490 commented on Sep 16, 2026

    @amitksingh1490
    Contributor

    Follow-up verification draft: #3878 (not PR Ready).

    I reviewed @imrehg's #3508, its approval, comments and inactivity closure first. The two-field production fix is already on current main via commit 9144a7200 (OrcaRouter work). Both LlamaCpp and LM Studio's current model-fetch paths share that DTO, so the draft adds regression coverage rather than duplicating the existing fix. Credit to @imrehg for the diagnosis, provider responses and original fix/manual verification.

    Local validation: 727 forge_app tests, 1 doctest (2 ignored), insta with no snapshot changes, crate all-target Clippy with warnings denied, and debug CLI build pass. Requiring the fields temporarily made the new LlamaCpp regression fail with the reported missing field modality error; restoring the current implementation returned the full suite to green.

    Isolated loopback fixtures passed built-in provider login/model selection and noninteractive -p for both providers, including LM Studio's Responses endpoint. This is mock evidence, not real provider inference/authentication. No real user configuration or credentials were changed. Workspace format checking finds unrelated pre-existing whitespace, left untouched. Current-head CI/autofix is being reviewed; no workflows approved or automation changed.

    Remaining external check: please confirm login/model selection and a harmless prompt against actual LlamaCpp/LM Studio installations, with sanitized results and versions. Known provider/model template issues are outside this model-list regression scope. The issue is not being automatically closed.

    Co-Authored-By: ForgeCode noreply@forgecode.dev

  14. github-actions commented on Oct 16, 2026

    @github-actions

    Action required: Issue inactive for 30 days.
    Status update or closure in 7 days.

  15. added
    state: inactiveNo current action needed/possible; issue fixed, out of scope, or superseded.
    on Oct 16, 2026
  16. github-actions commented on Oct 23, 2026

    @github-actions

    Issue closed after 7 days of inactivity.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    state: inactiveNo current action needed/possible; issue fixed, out of scope, or superseded.type: bugSomething isn't working.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions