Skip to main content

01 — Basic Invocation

The simplest way to call an LLM. Sends a message and prints the response.

02 — Async Invocation

Same as above, but using asyncio for non-blocking execution.

03 — Streaming

Stream tokens as they are generated for real-time output.

04 — Structured Output

Return Pydantic models instead of free text.

05 — Multi-Provider

Use the same message format across OpenAI, DeepSeek, Moonshot, and xAI.
Requires API keys for each provider: OPENAI_API_KEY, DEEPSEEK_API_KEY, MOONSHOT_API_KEY, XAI_API_KEY.

06 — Vision & Audio

Send images and audio to multimodal models.