Skip to content

Kingy / AI Fix Finder

← All fixes

LM Studio HTTP 500 hides a context-size error

The native LM Studio API wrapped a typed inner context-size rejection in an outer HTTP 500. The retained request contained 518 rendered input tokens while the loaded model had a 512-token context.

kingy tested

What happened

Symptom

The native LM Studio API wrapped a typed inner context-size rejection in an outer HTTP 500. The retained request contained 518 rendered input tokens while the loaded model had a 512-token context.

Conditions

LM Studio 0.4.26+4; llama.cpp Metal engine 2.60.0; same pinned Qwen3-4B Q4_K_M weights.

Loopback-only API, full unchanged synthetic source, temperature 0, reasoning disabled, one model/slot, 128-token output cap.

Model-file SHA-256 7485fe6f11af29433bc51cab58009521f205840f5b4ae3a32fa7f92e8534fdf5.

Correction

Reload the same model instance with a larger supported context. The retained correction used lms load qwen3-4b --context-length 2048 --gpu max --parallel 1 --identifier kingy-memory-lms. The load setting must take effect before repeating POST /api/v1/chat.

Result

0/3 baseline task passes; 3/3 corrected exact-task passes; 0/1 reverted task passes. The corrected cohort is shared with the other repair for this runtime.

What did not work

The unchanged 518-token request was rejected at a loaded 512-token context.

The CPU exploratory cohort timed out on its third corrected request; it did not qualify.

  1. Reload the same model instance with a larger supported context. The retained correction used lms load qwen3-4b --context-length 2048 --gpu max --parallel 1 --identifier kingy-memory-lms. The load setting must take effect before repeating POST /api/v1/chat.
  2. Preserve the full original input and enough output room, then verify every required fact. Here, 2048 was a tested setting for one 518-token synthetic request, not a universal minimum or a memory-fit promise.
  3. Inspect the retained request, loaded context and raw response before applying the correction to your own setup.
Sources & limits

Full LM Studio HTTP 500 hides a context-size error qualification report and limits

Download Ollama and LM Studio evidence ZIP (52,216 bytes; SHA-256 65272c0b665b287961907c19cb085473797ef83706a8ba754373b1847fecfb3b)

Record checked 2026-10-17.

Same agent, one Apple M4 Pro Mac with 24 GiB unified RAM, one Qwen3-4B Q4_K_M artifact. No independent human or second-machine reproduction.

Three baseline failures, three corrected exact-task passes and one reverted failure per repair. The two repairs for each runtime share the identical three corrected attempts; these are six unique corrected generations total, not twelve.

Fixed synthetic task, not a reliability estimate or proof for other models, versions or hardware. No real OOM condition was induced. No Ollama or LM Studio memory-fit calibration is claimed.

Existing weights were reused, with no model download or paid inference. A free official Ollama portable runtime was added; runtime binaries and weights are excluded from the evidence ZIP.

The earlier CPU-only cohort is unqualified: two corrected passes followed by a 120-second timeout. It remains in the evidence. The qualified cohort kept Metal GPU offload fixed across its conditions.

Native /api/v1/chat exposes no finish_reason. Acceptance required strict exact JSON, all original facts, zero reported reasoning tokens and reported output below the 128-token cap; no observed stop marker is claimed.

This still happens?

Send the smallest example that reproduces it. Use a public, non-sensitive example; leave out account details, keys and private files.

Help improve this tool

Did this help you finish?

About AI Fix Finder. Your feedback goes to Kingy’s private review queue.

Your experience with AI Fix Finder
What happened?