openclaw - 💡(How to fix) Fix [Feature]: Feature Request: Support LM Studio Native API [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#68678Fetched 2026-04-19 15:08:44
View on GitHub
Comments
2
Participants
2
Timeline
7
Reactions
0
Timeline (top)
closed ×2commented ×2reopened ×2labeled ×1

Add support for LM Studio's native API (/api/v1/chat) as a provider API type, offering ~15% faster token generation compared to the OpenAI-compatible endpoint.

Root Cause

Add support for LM Studio's native API (/api/v1/chat) as a provider API type, offering ~15% faster token generation compared to the OpenAI-compatible endpoint.

RAW_BUFFERClick to expand / collapse

Summary

Add support for LM Studio's native API (/api/v1/chat) as a provider API type, offering ~15% faster token generation compared to the OpenAI-compatible endpoint.

Problem to solve

OpenClaw only supports LM Studio through the OpenAI-compatible endpoint (/v1/chat/completions), which is ~15% slower than LM Studio's native API:

  • Native API: ~42 tokens/s
  • OpenAI Compatible: ~36 tokens/s

Users cannot take advantage of the faster native API through OpenClaw's model system.

Proposed solution

feature-request-lmstudio-native.md

Alternatives considered

  1. Using a proxy to convert OpenAI format to native API - adds overhead, negates speed benefit
  2. Using a skill to call native API directly - works but not integrated with OpenClaw's model system, requires manual invocation
  3. Waiting for LM Studio to optimize their OpenAI-compatible endpoint - not under OpenClaw's control

Impact

  • Users with local LM Studio setups will see 15% faster token generation
  • No breaking changes - existing OpenAI-compatible configuration continues to work
  • New API type is opt-in, users choose which endpoint to use

Evidence/examples

Benchmark results from testing on LM Studio 0.4+ with qwen3.6-35b-a3b model:

API Endpointtokens/sFirst Token Time
Native API (/api/v1/chat)42.50.6s
OpenAI Compatible (/v1/chat/completions)36.52.3s

Test command: curl -s -X POST http://127.0.0.1:1234/api/v1/chat
-H "Content-Type: application/json"
-H "Authorization: Bearer lmstudio"
-d '{"model":"qwen3.6-35b-a3b","input":"test","max_output_tokens":100}'

Response includes tokens_per_second in stats field.

Additional information

  • LM Studio version: 0.4+
  • Native API docs: Available at http://127.0.0.1:1234/api/v1/models when LM Studio server is running
  • Related: LM Studio integration was added in OpenClaw via OpenAI-compatible endpoint
  • This request adds native API support for better performance

extent analysis

TL;DR

Add support for LM Studio's native API as a provider API type in OpenClaw to utilize its 15% faster token generation capability.

Guidance

  • Review the proposed solution in feature-request-lmstudio-native.md for implementing native API support.
  • Verify the performance benefits by running benchmark tests similar to those provided, comparing the native API endpoint (/api/v1/chat) against the OpenAI-compatible endpoint (/v1/chat/completions).
  • Consider the impact on existing configurations, noting that the new API type is opt-in and does not introduce breaking changes.
  • Evaluate the test command provided as a basis for testing the native API integration, ensuring the Authorization header and JSON payload are correctly formatted.

Example

curl -s -X POST http://127.0.0.1:1234/api/v1/chat \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer lmstudio" \
  -d '{"model":"qwen3.6-35b-a3b","input":"test","max_output_tokens":100}'

Notes

The solution's effectiveness depends on the specific LM Studio version (0.4+) and the model used (e.g., qwen3.6-35b-a3b). Ensure that the native API documentation is consulted for any version-specific requirements or changes.

Recommendation

Apply the workaround by implementing the proposed solution to add native API support, as it offers a significant performance improvement without introducing breaking changes.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Feature]: Feature Request: Support LM Studio Native API [2 comments, 2 participants]