chat
Send prompts to local or cloud LLM providers with optional overrides for model, provider, system prompt, and temperature. Returns structured JSON with content and metadata.
Instructions
Chat with the configured LLM provider (local or cloud).
Uses the unified LLM client which auto-detects local providers (Ollama, LM Studio) and supports cloud providers (OpenAI, Anthropic, Google Gemini) via API keys.
The provider and model can be overridden per-request.
Return Format
{"success": bool, "content": str, "model": str, "provider": str}
Examples
await chat(prompt="What is the capital of Austria?") await chat(prompt="Explain quantum computing in 3 sentences", system="Be concise.") await chat(prompt="Hello", provider="openai", model="gpt-4o") await chat(prompt="Describe Vienna", temperature=0.3)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | Override model name. | |
| prompt | Yes | The message or question to send to the LLM. | |
| system | No | Optional system prompt to set context. | |
| provider | No | Override provider: ollama, lmstudio, openai, anthropic, google. | |
| max_tokens | No | Max tokens in response. | |
| temperature | No | Sampling temperature 0.0-2.0. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||