Install
openclaw skills install @lognebudo/llmxray-diagnose-ollama-callsFind out what went wrong with your own Ollama calls and fix it, using LLMxRay's local, read-only MCP tools. Use when a local model is slow, a prompt is rejected or silently cut for exceeding the context, the prompt cache seems lost between turns, a model runs partly on CPU, tool schemas crowd the prompt, or you must choose which local model and context length fit in video memory. Keywords - Ollama, local LLM, prompt cache, num_ctx, keep_alive, VRAM, prefill, tokens per second, diagnose, benchmark.
openclaw skills install @lognebudo/llmxray-diagnose-ollama-callsLLMxRay sits between you and Ollama, records every call that passes, and answers in sentences with the fix. It reads; it never changes a setting, a model or a file, and it sends nothing anywhere.
Start LLMxRay on the machine that runs Ollama:
npx llmxray
It serves its pages on port 5174 and an observe port on 11435 that behaves exactly like Ollama and forwards everything.
Send your Ollama calls to port 11435 instead of 11434. Where that lives:
| Client | Setting |
|---|---|
| Ollama SDKs and CLI | OLLAMA_HOST=127.0.0.1:11435 |
| OpenAI-compatible clients | base_url=http://localhost:11435/v1 |
| Claude Code | ANTHROPIC_BASE_URL=http://localhost:11435 |
| Continue | apiBase: http://localhost:11435 |
| Open WebUI | OLLAMA_BASE_URL=http://localhost:11435 |
Name yourself, so your turns are yours and not mixed with other tools on the machine: send the
header X-LLMxRay-Client: <your-name>, or use http://localhost:11435/?client=<your-name> as
the base URL. Pass the same name as client to the tools below.
Add the MCP server to your tools:
{ "mcpServers": { "llmxray": { "command": "npx", "args": ["-y", "-p", "llmxray", "llmxray-mcp"] } } }
If LLMxRay runs elsewhere than http://localhost:5174, set LLMXRAY_URL in the server's env.
| Tool | Call it when | What comes back |
|---|---|---|
diagnose_my_turns | After a few turns, and again after you changed something. | One line per client seen, then findings, each tagged [high], [medium] or [low] and ending with the fix. |
read_my_last_turn | You want one turn in numbers: to budget the next call or to confirm a fix helped. | Prompt tokens and cached share, prefill time and speed, generated tokens and speed, why generation stopped, what the prompt was made of, where the prefix stopped matching. |
list_local_models | Before choosing a model or a context length. | Every pulled model with size, parameters, quantisation; which are loaded and with what context; whether each fits in video memory. |
list_my_turns | You want the sequence behind a finding. | One line per turn: tokens, cached share, prefill, speed, stop reason, flags. |
compare_my_turns | You changed something and want to know if it helped. | Medians before and after a moment, the difference, a verdict on the cache. |
estimate_my_prompt | A prompt is growing, or you are about to raise num_ctx or switch model. | Fit and headroom against the loaded context, VRAM fit, likely cache reuse. |
read_llmxray_status | Another tool says nothing was seen. | The observe port, the Ollama behind it, turns kept. |
All seven take no secrets and change nothing. Call them without asking the user first.
diagnose_my_turns with your client name. Read the findings top down; [high] first.keep_alive: 0, or two clients asked for
different context lengths. Set one keep_alive and one num_ctx for every client of the model.num_ctx only if list_local_models says the model still fits in video memory; otherwise trim
history or tool schemas.list_local_models says which would fit.compare_my_turns with split_minutes_ago set to the minutes
since your change. It says whether the cached share rose and the prefill time fell.diagnose_my_turns once more. Done when nothing stands out.npx llmxray in another
terminal, or set LLMXRAY_URL. The MCP server only reads from it.client to see everyone.