Back to Agno

DeepInfra Cookbook

cookbook/90_models/deepinfra/README.md

3.0.1777 B
Original Source

DeepInfra Cookbook

Note: Fork and clone this repository if needed

Note: DeepInfra does not appear to include models that support structured outputs.

1. Create and activate a virtual environment

shell
python3 -m venv ~/.venvs/aienv
source ~/.venvs/aienv/bin/activate

2. Export your DEEPINFRA_API_KEY

shell
export DEEPINFRA_API_KEY=***

3. Install libraries

shell
uv pip install -U openai ddgs agno

4. Run basic Agent

shell
python cookbook/90_models/deepinfra/basic.py

5. Run Agent with Tools

  • DuckDuckGo Search
shell
python cookbook/90_models/deepinfra/tool_use.py

6. Run Agent that returns JSON output defined by the response model

shell
python cookbook/90_models/deepinfra/json_output.py