llm_generate
Generate text using an LLM with automatic routing to the best provider and fallback. Supports three-part prompts for improved quality.
Instructions
Generate text using an LLM. Routes to the best available provider with automatic fallback. Supports three-part prompts (system/context/instruction) for improved quality.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | Specific model ID (e.g. "claude-sonnet-4-20250514", "gpt-4o", "gemini-2.5-flash", "llama-3.3-70b-versatile") | |
| prompt | Yes | The user prompt to send to the LLM (legacy flat format). Use context+instruction for better results. | |
| strict | No | When true, only try the first resolved provider and disable fallback. | |
| system | No | Optional system prompt — role, personality, constraints | |
| context | No | Background information, data, or documents for the task | |
| project | No | Project scope for credential resolution (e.g. "ghagga", "md-evals"). Falls back to global credentials if not found. | |
| provider | No | Preferred provider ID (e.g. "anthropic", "openai", "google", "groq", "openrouter", "cerebras", "zai", "nvidia", "mistral", "sambanova", "hyperbolic", "claude-cli") | |
| maxTokens | No | Maximum output tokens (default: 4096) | |
| instruction | No | The actual task or question to perform |