Skip to content

Models

Within AgentKit, models are adapters that wrap a given provider (ex. OpenAI, Anthropic)‘s specific model version (ex. gpt-3.5).

Each Agent can each select their own model to use and a Network can select a default model.

import { openai, anthropic, gemini } from "@inngest/agent-kit";
import { openai, createAgent } from "@inngest/agent-kit";
const model = openai({ model: "gpt-3.5-turbo" });
const modelWithApiKey = openai({ model: "gpt-3.5-turbo", apiKey: "sk-..." });

Configure model hyper parameters (temperature, etc.)

Section titled “Configure model hyper parameters (temperature, etc.)”

You can configure the model hyper parameters (temperature, etc.) by passing the defaultParameters option:

import { openai, createAgent } from "@inngest/agent-kit";
const model = openai({
model: "gpt-3.5-turbo",
defaultParameters: { temperature: 0.5 },
});
import { createAgent } from "@inngest/agent-kit";
const supportAgent = createAgent({
model: openai({ model: "gpt-3.5-turbo" }),
name: "Customer support specialist",
system: "You are an customer support specialist...",
tools: [listChargesTool],
});
import { createNetwork } from "@inngest/agent-kit";
const network = createNetwork({
agents: [supportAgent],
defaultModel: openai({ model: "gpt-4o" }),
});

For a full list of supported models, you can always check the models directory here.

"gpt-4.5-preview"
"gpt-4o"
"chatgpt-4o-latest"
"gpt-4o-mini"
"gpt-4"
"o1"
"o1-preview"
"o1-mini"
"o3-mini"
"gpt-4-turbo"
"gpt-3.5-turbo"

Environment variable used for each model provider

Section titled “Environment variable used for each model provider”
  • OpenAI: OPENAI_API_KEY
  • Anthropic: ANTHROPIC_API_KEY
  • Gemini: GEMINI_API_KEY
  • Grok: XAI_API_KEY

Is there a model that you’d like to see included in AgentKit? Open an issue, create a pull request, or chat with the team on Discord in the #ai channel.

Contribute on GitHub - Fork, clone, and open a pull request.