Skip to content

Run your agents on Athena

Updated

An aixplain agent reasons with one LLM. Set that LLM to Athena, and every step of every run goes to the model it needs: hard reasoning to a frontier model, routine steps to faster ones. This article explains how to build an agent on Athena with the Agents SDK and how to move an existing agent to it.

Why run an agent on Athena

An agent makes many model calls to finish one task: it plans, calls tools, reads the results and writes the answer. Most of those calls are simple. On a single frontier model, each one costs frontier prices. On Athena, only the steps that need a frontier model pay for one.

Athena suits agents that mix hard and routine steps, such as support, research or document agents. If your agent does only hard reasoning, a single frontier model may serve it better.

Build an agent on Athena

You need the Agents SDK and an API key. See Build and deploy agents to set them up.

Pass Athena as the agent's llm:

from aixplain import Aixplain

aix = Aixplain(api_key="YOUR_API_KEY")

agent = aix.Agent(
    name="Support agent",
    description="Answers customer questions.",
    instructions="Answer in two short sentences.",
    llm=aix.Model.get("aixplain/llm-router/aixplain"),
).save()

result = agent.run("How do I reset my password?")
print(result.data.output)

llm takes a model object or a model ID, so llm="6ab559cabbbd3609ac7e86cf" works too. An asset path string on its own doesn't.

Move an existing agent to Athena

  1. Load the agent: agent = aix.Agent.get("YOUR_AGENT_ID").
  2. Set its LLM: agent.llm = aix.Model.get("aixplain/llm-router/aixplain").
  3. Save it: agent.save().
  4. Run your usual test requests and compare the answers and the cost with the previous model.

The change applies to new runs. To go back, set the previous model and save again.

Check the cost

Every run's trace shows its steps and the credits each one used. Steps on Athena are named Athena, not the model it chose. In code, result.used_credits gives a run's cost. Compare a few runs before and after the change to see what Athena saves on your agent's work.

Limitations

  • You can't choose the models behind Athena's tiers. For that, create your own router with Automode and give it to the agent.
  • An agent's other model settings, like planner, stay on the models you set.

Get help

  • Learn how Athena decides: see How Athena works.
  • Agent reference: see Agents in the Agents SDK docs.
  • Report a problem: email care@aixplain.com with the agent ID and a run ID.

Still need help?

Report a bug on GitHub or write to us, and include your version and operating system.