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

# Lean Install (litellm-free)

> Use PraisonAI without litellm — capability detection still works via a conservative static heuristic

On lean installs (no `litellm`), PraisonAI still detects what each model can do — structured outputs, function calling, prompt caching, and web search — via a conservative built-in heuristic.

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
graph LR
    Agent[🤖 Agent] --> Helper[🔎 supports_* helper]
    Helper --> Check{litellm present?}
    Check -->|Yes| LiteLLM[📚 litellm catalogue]
    Check -->|No| Heuristic[📐 Static heuristic]
    LiteLLM --> Decision[✅ Capability decision]
    Heuristic --> Decision

    classDef agent fill:#8B0000,stroke:#7C90A0,color:#fff
    classDef helper fill:#189AB4,stroke:#7C90A0,color:#fff
    classDef branch fill:#6366F1,stroke:#7C90A0,color:#fff
    classDef fallback fill:#F59E0B,stroke:#7C90A0,color:#fff
    classDef result fill:#10B981,stroke:#7C90A0,color:#fff

    class Agent agent
    class Helper helper
    class Check branch
    class LiteLLM helper
    class Heuristic fallback
    class Decision result
```

You installed PraisonAI without extra dependencies, and structured outputs still work.

## Quick Start

**1. Install lean (no litellm)**

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
pip install praisonaiagents
```

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonaiagents import Agent
from pydantic import BaseModel

class Recipe(BaseModel):
    name: str
    steps: list[str]

agent = Agent(name="Chef", instructions="Return a simple recipe.", llm="gpt-4o")
result = agent.chat("Give me a recipe for pancakes", output_pydantic=Recipe)
print(result)
```

Capability gating stays usable — `gpt-4o` still reports structured-output support without `litellm`.

**2. Add litellm for authoritative detection**

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
pip install litellm
```

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonaiagents import Agent
from pydantic import BaseModel

class Recipe(BaseModel):
    name: str
    steps: list[str]

agent = Agent(name="Chef", instructions="Return a simple recipe.", llm="gpt-4o")
result = agent.chat("Give me a recipe for pancakes", output_pydantic=Recipe)
print(result)
```

Same code, now backed by litellm's live catalogue — recommended for production and for newly-released models.

***

## How It Works

Each `supports_*` helper checks for `litellm` first, then falls back to the static heuristic only when litellm is absent.

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
sequenceDiagram
    participant Agent
    participant Helper as supports_* helper
    participant LiteLLM as litellm

    Agent->>Helper: supports_structured_outputs("gpt-4o")
    Helper->>LiteLLM: _get_litellm()
    alt litellm installed
        LiteLLM-->>Helper: litellm module
        Helper->>LiteLLM: litellm.supports_response_schema(...)
        LiteLLM-->>Helper: authoritative result
    else litellm not installed
        LiteLLM-->>Helper: None
        Helper->>Helper: run static heuristic
    end
    Helper-->>Agent: True / False
```

`litellm` stays authoritative whenever it is installed — even when a helper is missing or raises, the result is `False` rather than the heuristic, so an unsupported param never reaches a provider request. The static heuristic runs **only** when `litellm` is `None`.

| Situation | Result |
| - | - |
| Empty `""` model name | `False` |
| litellm installed | litellm's answer (authoritative) |
| litellm installed but helper missing / raises | `False` (stays authoritative) |
| litellm not installed | Static heuristic |
| Unknown / novel model, no litellm | `False` |

***

## What each model gets on a lean install

These are the exact patterns from the static heuristic — names are lowercased and any `provider/` prefix is stripped before matching.

| Model family | Structured outputs | Function calling | Parallel tools | Prompt caching | Native web search |
| - | :-: | :-: | :-: | :-: | :-: |
| GPT-4o / GPT-4.1 / GPT-5 | ✅ | ✅ | ✅ | ✅ | ❌¹ |
| o1 / o3 / o4 | ✅ | ✅ | ✅ | ❌ | ❌ |
| GPT-3.5 | ❌ | ✅ | ✅ | ❌ | ❌ |
| Claude 3 / Sonnet / Opus / Haiku | ✅ | ✅ | ✅ | ✅ | ❌² |
| Gemini 2.x | ✅ | ✅ | ✅ | ❌ | ✅ |
| Mistral / Mixtral / Llama 3 | ❌ | ✅ | ❌³ | ❌ | ❌ |
| Perplexity / Sonar | ❌ | ❌ | ❌ | ❌ | ✅ |
| Grok 3 | ❌ | ✅ | ❌ | ❌ | ✅ |
| DeepSeek | ❌ | ❌ | ❌ | ✅ | ❌ |
| Embeddings / Whisper / TTS / DALL-E | ❌ | ❌⁴ | ❌ | ❌ | ❌ |

¹ Only `*-search-preview` variants (e.g. `gpt-4o-search-preview`) report native web search.
² Claude uses `web_fetch` instead of native web search, so it is intentionally excluded from the web-search heuristic — this is expected, not a bug.
³ Mistral / Mixtral / Llama / Grok report **serial** function calling but **not** parallel — the parallel heuristic is deliberately narrower.
⁴ Function calling is disabled by design for `embedding`, `whisper`, `tts`, and `dall-e` model names.

> [!NOTE]
>
> The web-search heuristic also matches any model name containing the literal substring `search`, plus `gemini-2` and `grok-3`. Anthropic Claude is excluded on purpose.

***

## Lean or full install?

> [!NOTE]
>
> Use this to decide whether the lean install is enough or whether you should add `litellm`.

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
graph TB
    Q{Need authoritative detection for<br/>new or non-standard model IDs?}
    Q -->|Yes| Full[📚 Install litellm]
    Q -->|No| Lean[🪶 Lean install is fine]

    classDef question fill:#6366F1,stroke:#7C90A0,color:#fff
    classDef full fill:#189AB4,stroke:#7C90A0,color:#fff
    classDef lean fill:#10B981,stroke:#7C90A0,color:#fff

    class Q question
    class Full full
    class Lean lean
```

## When to install `litellm` anyway

Add `litellm` when a wrong `True` would break a real request.

* **Newly released models** with no matching pattern — the heuristic returns `False` until you add litellm.
* **Non-standard model IDs** — custom deployments, self-hosted proxies, or renamed models.
* **Production workloads** where a wrong `True` would send an unsupported `response_format` or `web_search_options` param and fail the call.

> [!NOTE]
>
> The helpers live at `praisonaiagents.llm.model_capabilities`, but you never call them directly — the Agent uses them for you. Just install `litellm` when you need authoritative detection.

***

## Best Practices

> [accordion] Install litellm for anything user-facing in production
>
> The static heuristic is conservative, not exhaustive. For production traffic, `pip install litellm` so capability detection matches each provider's live catalogue.

> [accordion] Lean installs are ideal for edge, serverless, and air-gapped CI
>
> When you target a single provider and want a small footprint, skip `litellm`. Structured outputs, function calling, and prompt caching still gate correctly for mainstream models.

> [accordion] litellm stays authoritative even when it errors
>
> When `litellm` is installed but a helper is missing or raises, the result is `False` — not the heuristic. Don't wrap these helpers with your own fallback; that would send unsupported params to the provider.

> [accordion] Unknown models return False — add litellm before shipping a new provider
>
> A novel model with no matching pattern reports `False` across the board on a lean install. Install `litellm` before shipping support for a new provider so its capabilities are detected.

***

## Related

> [card] [Lite Package (BYO-LLM)](https://praison.ai/docs/features/lite-package.md)
>
> A different feature — the `praisonaiagents.lite` subpackage with `LiteAgent`, not the litellm-free capability fallback.

> [card] [Installation Extras](https://praison.ai/docs/features/installation-extras.md)
>
> Optional dependency groups for bots, gateway, and storage.

> [card] [Model Fallback](https://praison.ai/docs/features/model-fallback.md)
>
> Fall back across models — also uses capability info.

> [card] [Model Capabilities](https://praison.ai/docs/features/model-capabilities.md)
>
> Higher-level model-selection layer, distinct from these `supports_*` helpers.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.