Skip to content

.act tool invocation fails - KeyError: value (broken model config json) #106

@stndart

Description

@stndart

Problem

When model tries to run a tool using .act, the call fails with KeyError: value (kv["value"])

Replication

Model

Any of
Qwen3-32B
QwQ-32B

Software

LM-Studio 0.3.17 (Build 11)
OS - Windows 10 Pro
CUDA llama.cpp v1.37.1
LMStudio Python SDK 1.4.0

Code

Tested with official documentation code: https://lmstudio.ai/docs/python/agent/act (scoped client variant over network)

Error:

Traceback (most recent call last):
  File "/root/radarange-orchestrator/examples/lmstudio_tool_docs.py", line 11, in <module>
    model.act(
  File "/usr/lib/python3.10/contextlib.py", line 79, in inner
    return func(*args, **kwds)
  File "/root/radarange-orchestrator/.venv/lib/python3.10/site-packages/lmstudio/sync_api.py", line 1390, in act
    for event in prediction_stream._iter_events():
  File "/root/radarange-orchestrator/.venv/lib/python3.10/site-packages/lmstudio/sync_api.py", line 926, in _iter_events
    for event in endpoint.iter_message_events(contents):
  File "/root/radarange-orchestrator/.venv/lib/python3.10/site-packages/lmstudio/json_api.py", line 1299, in iter_message_events
    load_config=parse_llm_load_config(load_kvconfig),
  File "/root/radarange-orchestrator/.venv/lib/python3.10/site-packages/lmstudio/_kv_config.py", line 347, in parse_llm_load_config
    return LlmLoadModelConfig._from_any_api_dict(parse_server_config(server_config))
  File "/root/radarange-orchestrator/.venv/lib/python3.10/site-packages/lmstudio/_kv_config.py", line 340, in parse_server_config
    value = kv["value"]
KeyError: 'value'

Speculations

When model tries to call a tool, it passes it's config to the sdk (json-api.py:1298, then _kv_config.py:346)
The config looks like:

{
'loadModelConfig': {
        'fields': [
            {
                'key': 'load.gpuSplitConfig',
                'value': {
                    'customRatio': [],
                    'disabledGpus': [],
                    'priority': [],
                    'strategy': 'evenly',
                },
            },
            {'key': 'load.gpuStrictVramCap', 'value': False},
            {'key': 'llm.load.llama.cpuThreadPoolSize', 'value': 6},
            {'key': 'llm.load.contextLength', 'value': 80000},
            {'key': 'llm.load.llama.acceleration.offloadRatio'},
            {'key': 'llm.load.llama.flashAttention', 'value': True},
        ]
    }
}

It clearly lacks 'value' field at 'llm.load.llama.acceleration.offloadRatio' key.

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