Skip to main content
basic.py
"""Use Agno with Tuning Engines as an OpenAI-compatible endpoint."""

from os import getenv

from agno.agent import Agent
from agno.models.tuning_engines import TuningEngines

agent = Agent(
    model=TuningEngines(
        id=getenv("TUNING_ENGINES_MODEL", "gpt-4o"),
    ),
    markdown=True,
)

agent.print_response(
    "Explain how governance, traces, and usage reporting help production AI agents.",
    stream=True,
)

Run the Example

1

Set up your virtual environment

uv venv --python 3.12
source .venv/bin/activate
uv venv --python 3.12
.venv\Scripts\activate
2

Install dependencies

uv pip install -U agno openai
3

Export your API keys

export TUNING_ENGINES_API_KEY="your_tuning_engines_api_key_here"
$Env:TUNING_ENGINES_API_KEY="your_tuning_engines_api_key_here"
4

Run the example

Save the code above as basic.py, then run:
python basic.py
Full source: cookbook/90_models/tuning_engines/basic.py