> ## Documentation Index
> Fetch the complete documentation index at: https://phidatainc.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# LiteLLM

> Run agents through the LiteLLM gateway with tools, knowledge, structured output, and audio, image, and PDF input.

| Example                                                                                       | Description                                                                                           |
| --------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| [LiteLLM Audio Input Agent](/examples/models/litellm/audio-input-agent)                       | Pass an MP3 file as audio input to a gpt-audio model routed through LiteLLM.                          |
| [LiteLLM Basic](/examples/models/litellm/basic)                                               | Run a Hugging Face Mistral model through LiteLLM with sync, async, and streaming calls.               |
| [LiteLLM Basic GPT](/examples/models/litellm/basic-gpt)                                       | Call OpenAI's gpt-4o through the LiteLLM model class for a basic agent response.                      |
| [DB](/examples/models/litellm/db)                                                             | Add storage to the Agent.                                                                             |
| [LiteLLM Image Agent](/examples/models/litellm/image-agent)                                   | Analyze an image from a URL with gpt-4o via LiteLLM and pull related news using web search.           |
| [LiteLLM Image Agent Bytes](/examples/models/litellm/image-agent-bytes)                       | Send an image as raw bytes to gpt-4o via LiteLLM and fetch related news with web search.              |
| [LiteLLM Knowledge](/examples/models/litellm/knowledge)                                       | Answer questions from a PDF knowledge base stored in PgVector using a LiteLLM agent.                  |
| [LiteLLM Memory](/examples/models/litellm/memory)                                             | Keep the last three runs in context and inspect stored session messages with a LiteLLM agent.         |
| [LiteLLM Metrics](/examples/models/litellm/metrics)                                           | Inspect per-message and run-level token metrics from a LiteLLM agent using YFinance tools.            |
| [LiteLLM PDF Input Bytes](/examples/models/litellm/pdf-input-bytes)                           | Pass a downloaded PDF as raw bytes to a LiteLLM agent and summarize its contents.                     |
| [LiteLLM PDF Input Local](/examples/models/litellm/pdf-input-local)                           | Attach a local PDF file to a LiteLLM agent and ask questions about a specific recipe.                 |
| [LiteLLM PDF Input URL](/examples/models/litellm/pdf-input-url)                               | Attach a PDF by URL to a LiteLLM agent and ask for a recipe from the document.                        |
| [LiteLLM Reasoning Agent Example](/examples/models/litellm/reasoning-agent)                   | Use reasoning models through LiteLLM.                                                                 |
| [Retry](/examples/models/litellm/retry)                                                       | Review retry settings and why invalid model IDs cannot reliably exercise the retry path.              |
| [LiteLLM Structured Output](/examples/models/litellm/structured-output)                       | Return a MovieScript Pydantic model via LiteLLM using JSON mode and native structured outputs.        |
| [LiteLLM Tool Use](/examples/models/litellm/tool-use)                                         | Call YFinance tools from a LiteLLM agent with sync, streaming, and async runs.                        |
| [LiteLLM Append Trailing User Message](/examples/models/litellm/append-trailing-user-message) | Append a trailing user turn so Claude 4.6+ models that reject assistant prefill work through LiteLLM. |
