Estimate my prompt
estimate_my_promptCheck if a prompt fits the loaded model's context, how much headroom remains for the answer, whether it sits in VRAM, and how much prompt cache reuses before sending.
Instructions
Before sending a prompt of N tokens: whether it fits the context the model is loaded with and the headroom left for the answer. Also whether the model sits in video memory, and how much of the prompt the cache would reuse, from this client's last turn on that model. Use it when a prompt grows, before raising num_ctx, or before switching model. For what is installed use list_local_models; for what actually happened use read_my_last_turn. model: a pulled model name, "gemma4" or "gemma4:latest"; unknown names get the list of pulled ones. prompt_tokens: 1 to 2000000, your estimate of the prompt size. client: your X-LLMxRay-Client name, so the cache estimate uses your own last turn. Needs Ollama reachable; the cache line needs LLMxRay running (npx llmxray). Under a second. No model is loaded or called.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"model": "<model>",
"prompt_tokens": "<prompt_tokens>"
},
"name": "estimate_my_prompt"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | Yes | A pulled model name, with or without the tag. | |
| client | No | Substring of the client label, for the cache estimate. Omit for the last caller. | |
| prompt_tokens | Yes | Size of the prompt you intend to send, in tokens, 1 to 2000000. |