llm_query
Query any OpenAI-compatible LLM endpoint with custom prompts, system instructions, and provider overrides, enabling flexible model access from your AI agent.
Instructions
Query ANY external LLM using an OpenAI-compatible /v1 endpoint (e.g. Dahl, DeepSeek, OpenRouter, Groq, Ollama, LM Studio, FreeLLMAPI, 9Router, OmniRoute, or any custom endpoint). Supports reasoning/thinking extraction, custom system prompts, and ad-hoc endpoint overrides.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | The specific model name/ID (e.g., "MiniMaxAI/MiniMax-M2.7", "deepseek-ai/DeepSeek-V4-Flash-0731", "deepseek-reasoner", "llama-3.3-70b-versatile"). If omitted, uses the provider default. | |
| preset | No | Name of system persona or prompt preset to apply (e.g. 'security-auditor', 'systems-architect', 'code-simplifier', 'quant-trader', 'fullstack-reviewer', 'explain-like-pro', or custom preset name). Automatically injects specialized system prompt and optimal temperature. | |
| prompt | Yes | The user prompt or query to send to the model. | |
| stream | No | Enable SSE streaming mode with live token telemetry (Time-To-First-Token and tokens/sec velocity calculation). Default is false. | |
| api_key | No | Ad-hoc API key to use with the endpoint_url or provider. | |
| fallback | No | Enable smart zero-downtime fallback cascade if the primary provider returns HTTP 429 (rate limit) or 5xx error. Default is true. | |
| provider | No | The provider alias to use from vault: "dahl", "openrouter", "deepseek", "groq", "ollama", "lmstudio", "freellmapi", "9router", "omniroute", "cerebras", or custom name. Defaults to active provider. | |
| cache_ttl | No | Cache time-to-live in seconds. Default is 86400 (24 hours). Use 0 for indefinite caching. | |
| use_cache | No | Check and store responses in the local dynamic response cache (0ms instant hits, zero token expenditure). Default is true. | |
| max_tokens | No | Maximum tokens to generate. | |
| temperature | No | Sampling temperature (0.0 to 1.0). Default is 0.7. | |
| endpoint_url | No | Ad-hoc OpenAI-compatible /v1 base URL (e.g., "https://inference.dahl.global/v1" or "http://localhost:11434/v1"). Overrides the provider vault. | |
| system_prompt | No | Optional system instructions or role specification. | |
| fallback_chain | No | Custom array of provider keys to try in sequence if primary fails (e.g. ["dahl", "groq", "deepseek", "ollama"]). | |
| compress_tokens | No | Enable RTK Smart Prompt Compression to strip redundant whitespace, duplicate logs, and deep library stack traces, saving 20%-40% on input tokens. Default is false. |