Skip to content

fix: switch local LM Studio configs from LMStudio to OpenAILike - #194

Merged
neoneye merged 1 commit into
PlanExeOrg:mainfrom
VoynichLabs:fix/local-openailike-only
Mar 8, 2026
Merged

neoneye merged 1 commit into
PlanExeOrg:mainfrom
VoynichLabs:fix/local-openailike-only

Conversation

@82deutschmark

Copy link
Copy Markdown
Collaborator

Single change: llm_config/local.json

Switches all local LM Studio model entries from class: LMStudio to class: OpenAILike with should_use_structured_outputs: true inside arguments.

Why: class: LMStudio sends the JSON schema as text in the user message — no grammar enforcement. class: OpenAILike with should_use_structured_outputs: true sends proper response_format: json_schema, which LM Studio enforces via Outlines grammar. Verified working on tonight's full pipeline run (63 tasks, 0 failures).

The llama_index LMStudio CustomLLM adapter uses PydanticOutputParser which
injects the Pydantic schema as text into the user message. It never sends
response_format:json_schema in the HTTP request. Small models receive the
schema as text and echo it back, causing structured output failures.

Fix: switch to OpenAILike with should_use_structured_outputs=true. This
triggers OpenAI._prepare_schema() which sends response_format:json_schema
directly in the API request, enabling grammar-enforced structured output
in LM Studio (llama.cpp grammar for GGUF, Outlines for MLX).

Also updates field names: model_name→model, base_url→api_base,
request_timeout→timeout, num_output→max_tokens, adds api_key and
is_chat_model required by OpenAILike.
@neoneye
neoneye merged commit 8bd1c72 into PlanExeOrg:main Mar 8, 2026
3 checks passed
@neoneye
neoneye deleted the fix/local-openailike-only branch March 8, 2026 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants