Agent Config: Choose a Model
Add agent.ts with defineAgent to pick a model and configure the runtime. Eve uses a default model until you override it.
What it is#
agent.ts is where you configure the agent — most importantly, which model it uses. Eve picks a sensible default, so the file is optional until you want control.
Why you'd care#
Different tasks want different models (cheap vs. capable). agent.ts is the one place to set that, plus runtime options via the AI Gateway.
Before#
You rely on Eve's default model and can't tell which one is answering.
After#
import { defineAgent } from "eve";
export default defineAgent({
model: "openai/gpt-5.4-mini",
});
Eve now routes calls through the chosen model. Runtime options (timeouts, retries, streaming) live here too, powered by the AI Gateway.
Do it yourself#
- Create
agent/agent.tsandexport default defineAgent({ model: "openai/gpt-5.4-mini" }). - Run
eve devand confirm responses still work. - Swap the model string and re-run to feel the difference.
Gotchas#
agent.tsis optional — only add it when you want to override the default.- The model string format follows the AI Gateway convention (
provider/model).
Recap#
agent.ts + defineAgent is your control panel: choose the model and tune the runtime. Next, we give the agent something to do — tools.