You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: LM Studio fails with "context-window" error when sending images #734
When connected to LM Studio, text-only chats work fine, but sending messages that include images fails with a "context-window" error and causes the connection to fail. The model itself supports images and has a large context window configured, and images are correctly recognized when chatting directly in LM Studio. Even when explicitly specifying the model in Askimo's model settings, the issue persists.
Root Cause: Askimo encodes images as base64 strings and counts them as text tokens, causing
massive token inflation. A 2 MB image becomes ~1.8M tokens instead of the ~576-1152 visual tokens
that LM Studio actually uses.
Example
2 MB image
LM Studio (binary): ~576-1152 visual tokens ✅ Works
Askimo (base64): ~1.8M text tokens ❌ Exceeds context window
Expected Behavior
Images should be successfully recognized and processed through Askimo when connected to LM Studio
The context-window error should not occur for models with adequate context window size
Chat with images should work the same way it does in LM Studio's native interface
Actual Behavior
Sending a message with images triggers: "context-window" error
The connection fails after the error
The model selection dropdown (when explicitly choosing the model) does not resolve the issue
Steps to Reproduce
Connect Askimo to a local LM Studio instance
Load a model that supports image input (e.g., LLaVA, GPT-4 Vision equivalent)
Verify the model has a large context window configured in LM Studio
Send a chat message that includes an image
Observe the "context-window" error and connection failure
Technical Details
Text-only messages to LM Studio work correctly
Images work in LM Studio's native chat interface
Issue occurs regardless of explicit model selection in Askimo settings
Context window size in LM Studio is configured appropriately for image input
Activity
haiphucnguyen commentedon Sep 28, 2026
Closed by #735