Basic

Use Agno with Tuning Engines as an OpenAI-compatible endpoint.

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-5.6-luna"),
    ),
    markdown=True,
)

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

Run the Example

Set up your virtual environment

uv venv --python 3.12
source .venv/bin/activate

Install dependencies

uv pip install -U agno openai

Select the deployment and inference key

Create an inference key authorized for your tenant's enabled model deployment and role. Use the inference key described in the provider setup, not a management credential. Set TUNING_ENGINES_MODEL to your deployment alias; the program already reads it.

export TUNING_ENGINES_API_KEY="your_inference_key_here"
export TUNING_ENGINES_MODEL="your_enabled_deployment_alias"

Run the example

Save the code above as basic.py, then run:

python basic.py

Full source: cookbook/90_models/tuning_engines/basic.py