PromptisePromptise
PlatformSoonEnterprise
DocsGitHub
Talk to usGet started
Promptise - AI Framework LogoPromptise

The full-stack framework for agentic systems. Build with the framework. Run it on the platform. Launch it with our engineers.

pip install promptise

[01] Product

  • Framework
  • Platform (coming soon)
  • Enterprise
  • How it works
  • Contact

[02] Framework

  • The Agent
  • The Interface
  • The Harness

[03] Resources

  • Documentation
  • GitHub
  • Why Promptise
  • Use cases
  • Roadmap
  • Guides
  • Learning Paths
  • Questions

[04] Company

  • About
  • Terms of Service
  • Privacy Policy
  • Cookie Policy
  • Subprocessors

© 2026 Promptise by Manser Ventures. All rights reserved.

hello@promptise.com
← Guides> Building AI agents in Python

Best LLM for AI Agents (2026): Picks, Prices, How to Test

The best LLM for AI agents in 2026 by use case, from public agent benchmarks and vendor prices, why the boards disagree, and how to test models yourself.

Level
Intermediate
Reading time
20 min
Published
Oct 10, 2026
Last updated
Oct 25, 2026
Tested with
Promptise 1.4.3
By
Promptise Team
  • Model Selection and Routing
  • Tool Calling
  • Evals and Testing
  • Cost Control
Contents · 20 sections↓
  1. 01What is the best LLM for AI agents in 2026?
  2. 02How do the best LLMs for agentic AI compare?
  3. 03What makes a good agent LLM?
  4. 04Which LLM has the best function calling for agents?
  5. 05When to use a small, cheap or open-weight model (and when not)
  6. 06Which model should you use to write agent prompts and code?
  7. 07What you need to test models on your own tools
  8. 08Step 1: Put your tools in an MCP server
  9. 09Step 2: Make the model a setting
  10. 10Step 3: Check every candidate before you run it
  11. 11Step 4: Write tasks with known answers
  12. 12Step 5: Run the tasks across your shortlist
  13. 13Step 6: Read the results, not just the score
  14. 14The complete example
  15. 15Where does Promptise fit in choosing a model?
  16. 16Running it in production
  17. 17Common problems and fixes
  18. 18Limitations
  19. 19Frequently asked questions
  20. 20Next steps

Choosing the best LLM for AI agents comes down to one question: which model calls your tools correctly, step after step, at a cost you can live with? This guide shows which models lead the public agent benchmarks in October 2026 for each use case, with prices and the error margins that separate them. It then explains what matters in an agent model, how to test a shortlist on your own tools, and how to switch models in one line with Promptise Foundry.

[01]

What is the best LLM for AI agents in 2026?

There is no single best LLM for AI agents in October 2026. Each public agent benchmark puts a different model first, and on most of them the top scores sit within each other's error margins. Meta's Muse Spark 1.1 leads MCP-Atlas, but four models from Anthropic, Alibaba and Z.ai are within its margin. The open-weight GLM-5.3-Flash leads Toolathlon-Verified, Kimi K3 leads MCPMark Verified, and Claude Opus 5.5 leads Terminal-Bench 4.0 on tbench.ai, where it runs in Anthropic's Claude Code agent. The newest releases haven't reached the tool-use boards yet. Use the table as a shortlist per use case: the best model for agentic work is the cheapest one that passes your own tasks.

Use case

Leading group

Evidence

Next in line

Price in / out (USD per 1M tokens)

Tool use and MCP servers

Muse Spark 1.1 (Meta), Claude Fable 5.1, Claude Opus 5, Qwen3.8-2.4T-A95B (Alibaba), GLM-5.3 (Z.ai)

MCP-Atlas: 88.1 ± 1.95, 87.2 ± 2.05, 85.8 ± 2.1, 84.5 ± 2.25, 84.2 ± 2.15. The ranges overlap

Gemini 3.5 Flash 83.6 (deprecated), Claude Fable 5 83.3, Kimi K3 82.3

$1.25 / $4.25, $10 / $50, $5 / $25, $2 / $6, $1.40 / $4.40

Coding agents

Claude Opus 5.5, Claude Sonnet 5.5, GPT-6 Astra

Terminal-Bench 4.0 in each maker's agent: 64.8% ± 3.1, 61.8% ± 2.9, 58.2% ± 2.8. In one shared agent (Artificial Analysis): 59.6%, 63.6%, 59.6%. GPT-6 Astra is just outside Opus 5.5's range on tbench.ai and joins the group because it ties Opus 5.5 in the shared agent

GPT-6.1 Sol (58.2%, 56.1%), Gemini 4 Argon (57.1%, shared agent), Claude Fable 5.1 (57.9%, 55.1%)

$4 / $20, $2 / $10, $10 / $50

Value for money

Muse Spark 1.1 and GLM-5.3 for tool use; Claude Sonnet 5.5 and GPT-6.1 Sol for coding

Muse Spark 1.1 and GLM-5.3 are in MCP-Atlas's top group at $1.25 to $1.40 per million input tokens, against $10 for Fable 5.1. Sonnet 5.5 is first or second on both Terminal-Bench 4.0 runs; GPT-6.1 Sol trails the leader by 6.6 to 7.5 points at the same price

Gemini 4 Argon ($2 / $10 until November 30, 2026, then $4 / $20), Qwen3.8-Max ($2 / $6)

$1.25 / $4.25, $1.40 / $4.40, $2 / $10, $2 / $10

Cheapest, for high-volume steps

GLM-5.3-Flash, Claude Haiku 5.5, DeepSeek V4.1 Flash

Shared-agent Terminal-Bench 4.0: 32.8%, 32.8%, 33.8%. GLM-5.3-Flash also leads Toolathlon-Verified

GPT-6 Luna (16.4%, 12.6%), Muse Spark 1.3 in Contributor mode ($0.10 / $0.20; Meta may train on your content)

$0.15 / $0.50, $0.10 / $0.50 for prompts up to 100K tokens, $0.30 / $1.20 at peak and half off-peak

Open weights

GLM-5.3-Flash, Kimi K3, Qwen3.8-2.4T-A95B, GLM-5.3

Toolathlon-Verified: 78.4 ± 1.9, 76.5 ± 1.9. MCP-Atlas: 84.5 ± 2.25, 84.2 ± 2.15

DeepSeek V4 Pro 0813 (74.4 on Toolathlon-Verified, MIT), Muse Spark Open (Meta), Inkling-Small (Thinking Machines, Apache 2.0)

$0.15 / $0.50, $3 / $15, $2 / $6, $1.40 / $4.40 on the makers' APIs. Only GLM-5.3-Flash is MIT-licensed; the others use their makers' own licenses

Long multi-step tasks

GLM-5.3-Flash, Kimi K3, Claude Opus 4.8, Muse Spark 1.2

Toolathlon-Verified, where agents average about 20 to 48 turns per task: 78.4 ± 1.9, 76.5 ± 1.9, 76.2 ± 3.4, 75.9 ± 1.3

Newer models aren't on Toolathlon-Verified yet. On shared-agent Terminal-Bench 4.0, Claude Sonnet 5.5, Claude Opus 5.5, GPT-6 Astra and Gemini 4 Argon lead

$0.15 / $0.50, $3 / $15, $5 / $25, $1.25 / $4.25

One strong model is missing from the picks because you can't call it from your own code: Meta's Muse Wonder Full scores 56 on the Artificial Analysis Intelligence Index, behind only Claude Opus 5.5 (58) and level with Claude Sonnet 5.5, but Meta offers it only inside its Muse Code subscription. The Promptise model strings for every pick are in the Promptise section below.

Key takeaways:

  • Different boards, different leaders. Five boards put five different models first, from Muse Spark 1.1 on MCP-Atlas to Qwen3.8 Max on τ-bench's banking track.

  • Most leads are inside the margin of error. The top five on MCP-Atlas are 3.9 points apart, and each score carries a range of about ±2 points.

  • A score belongs to a model and a harness. On Terminal-Bench 4.0, Grok 4.7 scores 37.6% in its maker's Grok Build agent and 25.8% in the shared agent Artificial Analysis uses.

  • Boards lag releases. Of the September and October 2026 models, only Claude Fable 5.1 is on MCP-Atlas, and none is on Toolathlon-Verified yet.

  • Keep the model a setting. Then trying a new release is one changed string and one eval run.

How we picked

We read every score on the leaderboard itself and every price on the maker's own pricing or model page on October 21, 2026; the benchmark table below links each board. A model joins a use case's leading group when its range on that board overlaps the top score's range. Boards disagree, and terminal and coding scores depend on the agent harness, so every number in this guide names its board. This guide was researched and drafted with AI assistance, including Anthropic's Claude, and every number was checked against its source. Promptise has no commercial relationship with any model vendor and earns nothing from these picks.


[02]

How do the best LLMs for agentic AI compare?

The boards split in time. The tool-use boards (MCP-Atlas, Toolathlon-Verified and MCPMark Verified) list almost none of the September and October 2026 releases, so the first table ranks mostly the models of mid-2026. The second table has the current models from each maker on the boards that already test them. A dash means the model has no entry on that board on October 21, 2026.

The tool-use boards

Every model in the top 10 of MCP-Atlas or Toolathlon-Verified, and all eight models on MCPMark Verified:

Model (maker)

MCP-Atlas

Toolathlon-Verified

MCPMark Verified

Weights

Price in / out (USD per 1M)

Status on October 21, 2026

Muse Spark 1.1 (Meta)

88.1 ± 1.95

75.6 ± 0.4

-

Closed

$1.25 / $4.25

On Meta's Model API; Muse Spark 1.3 is newer

Claude Fable 5.1 (Anthropic)

87.2 ± 2.05

-

-

Closed

$10 / $50

Current

Claude Opus 5 (Anthropic)

85.8 ± 2.1

-

-

Closed

$5 / $25

Opus 5.5 is newer

Qwen3.8-2.4T-A95B (Alibaba)

84.5 ± 2.25

-

-

Open, Qwen license

$2 / $6

Qwen3.8-Max is the hosted version

GLM-5.3 (Z.ai)

84.2 ± 2.15

-

-

Open, GLM-5.3 license

$1.40 / $4.40

Current

Gemini 3.5 Flash (Google)

83.6 ± 2.3

67.3 ± 1.2

-

Closed

-

Deprecated; calls now go to Gemini 3.6 Flash

Claude Fable 5 (Anthropic)

83.3 ± 2.25

-

86.61%

Closed

$10 / $50

Fable 5.1 is newer

Kimi K3 (Moonshot AI)

82.3 ± 2.35

76.5 ± 1.9

96.06%

Open, Kimi K3 license

$3 / $15

Current; Kimi K3.1 Pro (closed weights) is newer

Muse Spark, no version given (Meta)

82.2 ± 2.3

-

-

Closed

-

The board doesn't say which version

Claude Opus 4.8 (Anthropic)

82.2 ± 2.4

76.2 ± 3.4

76.38%

Closed

$5 / $25

Older

GPT-5.6 Sol (OpenAI)

81.8 ± 2.4

-

92.91%

Closed

$4 / $20, promotional

GPT-6.1 Sol is newer

GLM-5.3-Flash (Z.ai)

-

78.4 ± 1.9

-

Open, MIT

$0.15 / $0.50

Current

Muse Spark 1.2 (Meta)

-

75.9 ± 1.3

-

Closed

$1.25 / $4.25

Muse Spark 1.3 is newer

DeepSeek V4 Pro 0813 (DeepSeek)

-

74.4 ± 1.2

71.65% (earlier V4 Pro)

Open, MIT

$1.32 / $3.96 at peak, half off-peak

Current

GPT-5.5 (OpenAI)

-

73.5 ± 1.2

92.91%

Closed

$5 / $30

Older

Claude Sonnet 5 (Anthropic)

-

71.6 ± 1.2

-

Closed

$2 / $10

Sonnet 5.5 is newer

DeepSeek V4 Flash 0731 (DeepSeek)

-

70.7 ± 0.9

-

Open, MIT

-

Retired; the API now serves V4.1 Flash

Kimi K2.7 Code (Moonshot AI)

-

58.0 ± 4.3

81.89%

Open, Kimi license

$0.95 / $4

On the API until K2 models retire at the end of December 2026

Kimi K2.6 (Moonshot AI)

-

58.0 ± 4.9

72.83%

Open, Kimi license

$0.95 / $4

On the API until K2 models retire at the end of December 2026

MCPMark Verified ran each model once and shows no ± range. For the other two boards, ± is the range the board publishes. Also on the boards: Thinking Machines' Inkling-Small scores 79.2 on MCP-Atlas (12th) under an Apache 2.0 license, and NVIDIA's open-weight Nemotron 3 Ultra scores 63.1 on MCP-Atlas and 34.3 on Toolathlon-Verified.

The current models

The current models from each maker, with the two Terminal-Bench 4.0 runs that include them and the Artificial Analysis Intelligence Index, a general score across ten evaluations rather than an agent benchmark:

Model (maker)

Price in / out (USD per 1M)

Context

Terminal-Bench 4.0 on tbench.ai (agent)

Terminal-Bench 4.0, same agent for all

AA Intelligence Index

Claude Opus 5.5 (Anthropic)

$4 / $20

1M

64.8% ± 3.1 (Claude Code)

59.6%

58

Claude Sonnet 5.5 (Anthropic)

$2 / $10

1M

61.8% ± 2.9 (Claude Code)

63.6%

56

Muse Wonder Full (Meta)

Not on the API

1M

-

57.1%

56

GPT-6 Astra (OpenAI)

$10 / $50

1.05M

58.2% ± 2.8 (Codex)

59.6%

53

Claude Fable 5.1 (Anthropic)

$10 / $50

1M

57.9% ± 3.8 (Claude Code)

55.1%

53

Gemini 4 Argon (Google)

$2 / $10 until November 30, 2026, then $4 / $20

1M

-

57.1%

53

GPT-6.1 Sol (OpenAI)

$2 / $10

1.05M

58.2% ± 3.1 (Codex)

56.1%

52

Muse Wonder 1.0 (Meta)

$4 / $20

1M

-

52.0%

52

Muse Spark 1.3 (Meta)

$1.25 / $4.25

1M

14.5% ± 2.9 (Muse Code)

33.3%

48

Grok 4.7 (SpaceXSI)

$2 / $6

500K

37.6% ± 3.5 (Grok Build)

25.8%

46

GLM-5.3 (Z.ai)

$1.40 / $4.40

1M

41.8% ± 3.2 (Claude Code)

41.9%

45

Qwen3.8-Max (Alibaba)

$2 / $6

1M

27.0% ± 3.8 (Claude Code)

38.9%

45

DeepSeek V4.1 Flash (DeepSeek)

$0.30 / $1.20 at peak, half off-peak

1M

-

33.8%

45

Kimi K3 (Moonshot AI)

$3 / $15

1M

-

12.6%

44

Claude Haiku 5.5 (Anthropic)

$0.10 / $0.50 up to 100K-token prompts, then $0.50 / $2.50

1M

-

32.8%

43

GLM-5.3-Flash (Z.ai)

$0.15 / $0.50

1M

35.8% ± 3.5 (Claude Code)

32.8%

42

Gemini 3.8 Flash (Google)

$0.75 / $3.75 until December 31, 2026, then $1.50 / $7.50

1M

19.1% ± 3.4 (mini-SWE-agent)

19.7%

41

Mistral Large 4 (Mistral, preview, open weights)

$1.36 / $4.18

1M

-

26.8%

38

GPT-6 Luna (OpenAI)

$0.10 / $0.50

1.05M

16.4% ± 2.7 (Codex)

12.6%

38

The first Terminal-Bench column is tbench.ai, with the agent each entry used. The second is Artificial Analysis's run of the same 66 tasks with mini-swe-agent for every model, averaged over three repeats; it publishes no range. Both columns and the Intelligence Index show each model's best reasoning-effort setting. Xiaomi's MiMo-V2.6-Pro (34.8%) and StepFun's Step 5 Preview (33.3%) also sit near GLM-5.3-Flash on that run. Since these tables were read, Moonshot AI released Kimi K3.1 Pro (closed weights) on October 23, 2026. It now leads Artificial Analysis's Terminal-Bench 4.0 run at 67.2%, ahead of Claude Sonnet 5.5 at 63.6%, and isn't on the tool-use boards yet.

Prices are the standard tier from each maker's own page: Anthropic, OpenAI, Google, Meta, SpaceXSI, Z.ai, Moonshot AI, DeepSeek, Alibaba Cloud and Mistral. OpenAI charges 2x input and 1.5x output above 272K input tokens, Grok 4.7 charges more above 200K, and GPT-5.6 Sol's promotional price runs at least through November 21, 2026.

What the tables show:

  • No model leads everywhere. Kimi K3 is first on MCPMark Verified (96.06%), second on Toolathlon-Verified, eighth on MCP-Atlas and at 12.6% on Artificial Analysis's Terminal-Bench 4.0 run.

  • The harness moves scores. On tbench.ai, most models run in their maker's own agent: Claude Code, Codex, Grok Build or Muse Code. Z.ai's and Alibaba's models run in Claude Code, and Google's in mini-SWE-agent. With one agent for every model, the gaps shrink: Claude Opus 5.5 and GPT-6 Astra both score 59.6%, and Claude Sonnet 5.5 comes first at 63.6%. For comparing models, the same-agent run is the fairer of the two, though with 66 tasks one task is worth 1.5 points.

  • Cheap models fall off on long tasks. GPT-6 Luna and Gemini 3.8 Flash stay under 20% on Terminal-Bench 4.0, while Claude Haiku 5.5, GLM-5.3-Flash and DeepSeek V4.1 Flash reach about 33%.

  • Open-weight models are at the top of the tool-use boards. Qwen3.8, GLM-5.3 and Kimi K3 are in MCP-Atlas's top eight, and GLM-5.3-Flash and Kimi K3 lead Toolathlon-Verified.


[03]

What makes a good agent LLM?

The best LLM for agents is not always the best chatbot. A chat model is judged on one reply. An agent model is judged on a loop: it reads the instructions and the tool definitions, decides whether to call a tool, writes the call, reads the result, and repeats until it can answer. Every turn of that loop is a chance to fail, and a mistake early in the loop spoils everything after it.

One agent run: the model reads its context, calls a tool or answers, the tool's result joins the history, and the loop repeats until the final answer. Each numbered step maps to one of the six properties that decide which model fits an agent.
FigureOne agent run, and what each step tests in a model

Six properties decide whether a model works for your agent:

  • Context window. The system prompt, every tool schema and every tool result share one window. Forty tools can use thousands of tokens before the user's question arrives, which is why connecting fewer tools often helps more than a bigger window.

  • Tool-calling reliability. The model picks the right tool, fills the arguments from the conversation instead of inventing them, and knows when no tool fits (how tool calling works).

  • Latency. The agent waits for the model at every step: ten steps at six seconds each is a minute.

  • Multi-turn consistency. The model keeps the goal and the rules across many turns and recovers when a tool returns an error. Small error rates compound: a model that gets 95% of steps right finishes a 10-step task without a mistake only 60% of the time.

  • Structured output. When your code parses the answer, a correct answer in the wrong format is a failure. Most providers offer strict modes that hold tool arguments or the final answer to a JSON schema.

  • Cost per task. The history and tool results are resent on each step, so input tokens dominate agent bills. A cheap model that needs more steps can cost more per task than a pricier one.


[04]

Which LLM has the best function calling for agents?

It depends on which board you read and when it was last updated. Each benchmark tests a different slice of agent work, and most of them lag the newest releases by months:

Benchmark

What it measures

Data on October 21, 2026

Leader

Not on it yet

MCP-Atlas

Multi-step workflows over 36 real MCP servers and 220 tools

Re-scored in April 2026 with a new judge and a 100-tool-call budget; lists models up to September

Muse Spark 1.1, 88.1 ± 1.95, with four models in range

Claude Opus 5.5 and Sonnet 5.5, GPT-6, Gemini 4 Argon, Muse Spark 1.3, Grok, DeepSeek, Mistral

Toolathlon-Verified

108 long tasks on 32 MCP servers with 604 tools

Released June 30, 2026; newest entry August 30

GLM-5.3-Flash, 78.4 ± 1.9

Every September and October release

MCPMark Verified

127 tasks on Filesystem, GitHub, Notion, Playwright and Postgres servers

Updated July 20, 2026; eight models, one run each

Kimi K3, 96.06%

Google, Meta, Z.ai, Alibaba, SpaceXSI, Mistral, and every newer model

τ-bench

Conversations with a simulated user, tools and a policy

Airline, retail and telecom runs end in spring 2026; the newest banking runs are dated August 4, 2026

Banking: Qwen3.8 Max 55.2, then Claude Opus 5 48.7

The September and October releases

BFCL V4

Function calls: single, parallel, multi-turn, plus web search and memory tasks

Last updated April 12, 2026

Claude Opus 4.5, 77.47%

Every model released in 2026; the newest entry is GPT-5.2 from December 2025

Terminal-Bench 4.0

End-to-end tasks in a terminal, scored per model and agent

Version 4.0 since August 26, 2026; has the September models

Claude Opus 5.5 with Claude Code, 64.8% ± 3.1

Gemini 4 Argon, Kimi, DeepSeek, Mistral, Muse Wonder

Terminal-Bench 4.0 by Artificial Analysis

The same 66 tasks, every model in one agent (mini-swe-agent), three repeats

Most current models, including October releases

Claude Sonnet 5.5, 63.6%

Models it hasn't run yet

SWE-bench Verified

Patches for real GitHub issues

Newest entry February 26, 2026

Claude Opus 4.5 in two agents, 79.2%

Every model since March 2026

SWE-Bench Pro V2

Harder patches: 642 tasks in 11 repositories

Updated September 22, 2026

Claude Opus 5 with Claude Code, 98.0

Claude Opus 5.5, GPT-6.1 Sol. The agent differs per row

Read the numbers with five caveats:

  • The mode matters. On BFCL, Claude Opus 4.5 scores 77.47% with native function calling and 33.47% with tools described in the prompt.

  • The harness matters. On Terminal-Bench 4.0, Qwen3.8-Max scores 27.0% in Claude Code and 38.9% in the shared agent Artificial Analysis uses.

  • Small leads are noise. When two scores' ± ranges overlap, the models are tied on that board.

  • Boards lag releases. A model missing from a board is untested, not weak.

  • Vendor numbers are not independent. Model cards report scores on the vendor's own settings.


[05]

When to use a small, cheap or open-weight model (and when not)

Choose

When

Watch out for

A frontier model (Claude Opus 5.5 or Fable 5.1, GPT-6 Astra, Gemini 4 Argon, Muse Wonder)

Long runs with many tools, vague tasks, code changes, anything costly to get wrong

Cost per task, and latency on every step

A mid-price model (Claude Sonnet 5.5, GPT-6.1 Sol, Muse Spark, GLM-5.3, Qwen3.8-Max)

Most production agents

Rare failures on the longest tasks; test them

A small model (GPT-6 Luna, Claude Haiku 5.5, GLM-5.3-Flash, DeepSeek V4.1 Flash)

Routing, classification, one or two tool calls, high volume

Invented arguments and skipped steps as tasks get longer

An open-weight model (GLM-5.3, Kimi K3, Qwen3.8, DeepSeek V4, Muse Spark Open, Mistral Large 4)

Data that must stay on your network, price, fine-tuning

Serving cost, licenses that differ per model, and tool-call parser setup, covered in the best local LLM for AI agents

You don't have to pick one. Many agents send simple steps to a small model and hard ones to a large model, as LLM routing explains. A gateway such as OpenRouter puts most of these models behind one key; see OpenRouter AI agent with MCP.


[06]

Which model should you use to write agent prompts and code?

The model that helps you build an agent doesn't have to be the model that runs it. Building is coding and writing work: drafting the system prompt, writing tool descriptions, writing the MCP server and the tests. Running is tool calling, step after step, at production volume. Choose the two separately.

  • For writing agent code, look at the coding boards. On Artificial Analysis's Terminal-Bench 4.0 run, where every model uses the same agent, Claude Sonnet 5.5 (63.6%), Claude Opus 5.5 (59.6%) and GPT-6 Astra (59.6%) lead, with GPT-6.1 Sol (56.1%), Gemini 4 Argon (57.1%) and Claude Fable 5.1 (55.1%) close behind. With 66 tasks, one task is worth 1.5 points, so treat the top group as tied. Use the one you already have access to, in the coding tool you already use.

  • For writing complex agent prompts, no public benchmark measures it. Any model from the frontier or mid-price rows of the table above can draft a clear system prompt, tool descriptions and edge cases. What decides quality is testing: run the prompt on the model that will execute it, with the eval in steps 4 to 6, and revise from the failures. A prompt written by one model and tested on another is normal.

  • For your first agent, pick a mid-price model you can call today, such as Claude Sonnet 5.5, GPT-6.1 Sol or Gemini 4 Argon ($2 / $10 per million tokens each, Gemini's price until November 30, 2026), and use it both to help you write the code and to run the agent. Swap the runtime model later, once your eval shows a cheaper one passes.

Keep the agent system prompt and the tool descriptions in files under version control, so you can regenerate or edit them with any model and rerun the eval.


[07]

What you need to test models on your own tools

  • Python 3.10 or later and Promptise Foundry 1.4.3 or later.

  • A key for at least one provider. The examples use OpenAI (OPENAI_API_KEY) because that was the key available when this guide was written. Any provider in the tables works the same way.

  • About 15 minutes. In the run below, ten tasks cost between $0.002 and $0.03 per model.

>_Terminal
pip install "promptise>=1.4.3"
export OPENAI_API_KEY="sk-..."

[08]

Step 1: Put your tools in an MCP server

A leaderboard tests someone else's tools; your eval should test yours. Here they are a small shop with fixed data, so every question has one right answer. In your project, use the MCP servers your agent already has.

Pythonshop_server.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
from promptise.mcp.server import MCPServer

server = MCPServer("shop")

# A small, fixed dataset, so every eval task has one right answer.
PRODUCTS = {
    "MUG-01": {"name": "Ceramic mug", "price_eur": 12.50, "stock": 42},
    "CUP-02": {"name": "Travel cup", "price_eur": 9.90, "stock": 7},
    "LAMP-03": {"name": "Desk lamp", "price_eur": 39.00, "stock": 15},
    "LAMP-04": {"name": "Floor lamp", "price_eur": 89.00, "stock": 4},
    "DESK-05": {"name": "Standing desk", "price_eur": 499.00, "stock": 3},
}
CUSTOMERS = {
    "C-7": {"name": "Dana Ito", "country": "PT", "tier": "gold"},
    "C-8": {"name": "Lee Park", "country": "DE", "tier": "standard"},
    "C-9": {"name": "Sam Ruiz", "country": "US", "tier": "standard"},
}
ORDERS = {
    "A-1001": {"customer_id": "C-8", "items": [{"sku": "MUG-01", "qty": 2}], "status": "shipped"},
    "A-1002": {"customer_id": "C-7", "items": [{"sku": "LAMP-03", "qty": 1}], "status": "processing"},
    "A-1003": {"customer_id": "C-7", "items": [{"sku": "DESK-05", "qty": 1}], "status": "delivered"},
    "A-1004": {"customer_id": "C-7", "items": [{"sku": "CUP-02", "qty": 3}], "status": "cancelled"},
    "A-1005": {"customer_id": "C-9", "items": [{"sku": "LAMP-04", "qty": 1}, {"sku": "MUG-01", "qty": 1}], "status": "shipped"},
}
EUR_RATES = {"USD": 1.087, "GBP": 0.842, "CHF": 0.937}
SHIPPING = {"DE": (4.90, 1.20), "PT": (6.90, 2.10), "US": (19.00, 4.50)}  # base fee, per kg


@server.tool()
async def get_order(order_id: str) -> dict:
    """Get an order: customer ID, items (SKU and quantity), status and total in EUR."""
    order = ORDERS.get(order_id.strip().upper())
    if order is None:
        return {"error": f"No order {order_id}."}
    total = sum(PRODUCTS[i["sku"]]["price_eur"] * i["qty"] for i in order["items"])
    return {"order_id": order_id.strip().upper(), **order, "total_eur": round(total, 2)}


@server.tool()
async def list_orders(customer_id: str) -> list[str]:
    """List the IDs of every order a customer has placed, including cancelled ones."""
    return [oid for oid, o in ORDERS.items() if o["customer_id"] == customer_id.strip().upper()]


@server.tool()
async def get_customer(customer_id: str) -> dict:
    """Get a customer: name, two-letter country code and loyalty tier."""
    customer = CUSTOMERS.get(customer_id.strip().upper())
    if customer is None:
        return {"error": f"No customer {customer_id}."}
    return {"customer_id": customer_id.strip().upper(), **customer}


@server.tool()
async def get_product(sku: str) -> dict:
    """Get a product by SKU: name, unit price in EUR and units in stock."""
    product = PRODUCTS.get(sku.strip().upper())
    if product is None:
        return {"error": f"No product {sku}."}
    return {"sku": sku.strip().upper(), **product}


@server.tool()
async def search_products(query: str) -> list[dict]:
    """Find products whose name contains the query. Returns SKU and name only."""
    q = query.lower().rstrip("s")
    return [{"sku": s, "name": p["name"]} for s, p in PRODUCTS.items() if q in p["name"].lower()]


@server.tool()
async def convert_from_eur(amount_eur: float, currency: str) -> dict:
    """Convert an amount in EUR to USD, GBP or CHF at today's rate."""
    rate = EUR_RATES.get(currency.strip().upper())
    if rate is None:
        return {"error": f"No rate for {currency}. Supported: USD, GBP, CHF."}
    return {"amount_eur": amount_eur, "currency": currency.upper(), "rate": rate, "amount": round(amount_eur * rate, 2)}


@server.tool()
async def shipping_cost(country: str, weight_kg: float) -> dict:
    """Shipping cost in EUR for a parcel to a country (two-letter code, for example "DE")."""
    fees = SHIPPING.get(country.strip().upper())
    if fees is None:
        return {"error": f"We don't ship to {country}."}
    base, per_kg = fees
    return {"country": country.upper(), "weight_kg": weight_kg, "cost_eur": round(base + per_kg * weight_kg, 2)}


if __name__ == "__main__":
    server.run()

Some answers need one call. Others need the model to chain calls, such as order to customer to shipping cost, or to notice that search_products returns no stock, so it has to fetch each product.


[09]

Step 2: Make the model a setting

This is the whole agent. The model comes from AGENT_MODEL, so nothing else changes when you switch:

Pythonagent.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import asyncio
import os
import sys

from promptise import build_agent
from promptise.config import StdioServerSpec

# The only line that knows which model runs the agent.
MODEL = os.environ.get("AGENT_MODEL", "openai:gpt-6-luna")


async def main():
    agent = await build_agent(
        model=MODEL,
        servers={"shop": StdioServerSpec(command=sys.executable, args=["shop_server.py"])},
        instructions="You are a shop assistant. Look everything up with your tools; never guess.",
        trace_tools=True,
    )
    try:
        result = await agent.ainvoke(
            {"messages": [{"role": "user", "content": "Where is order A-1001, and who ordered it?"}]}
        )
        print(f">>> [{MODEL}]", result["messages"][-1].text)
    finally:
        await agent.shutdown()


asyncio.run(main())

Run it with the default model, then with another one:

>_Terminal
python agent.py
AGENT_MODEL=openai:gpt-6.1-sol python agent.py
Output
→ Invoking tool: get_order with {'order_id': 'A-1001'}
✔ Tool result from get_order: {"order_id": "A-1001", "customer_id": "C-8", "items": [{"sku": "MUG-01", "qty": 2}], "status": "shipped", "total_eur": 25.0}
→ Invoking tool: get_customer with {'customer_id': 'C-8'}
✔ Tool result from get_customer: {"customer_id": "C-8", "name": "Lee Park", "country": "DE", "tier": "standard"}
>>> [openai:gpt-6-luna] Order A-1001 is marked **shipped** and is for **Germany**. It was ordered by **Lee Park**. The available order details don’t include a more precise delivery location or live tracking.
→ Invoking tool: get_order with {'order_id': 'A-1001'}
✔ Tool result from get_order: {"order_id": "A-1001", "customer_id": "C-8", "items": [{"sku": "MUG-01", "qty": 2}], "status": "shipped", "total_eur": 25.0}
→ Invoking tool: get_customer with {'customer_id': 'C-8'}
✔ Tool result from get_customer: {"customer_id": "C-8", "name": "Lee Park", "country": "DE", "tier": "standard"}
>>> [openai:gpt-6.1-sol] Order **A-1001** was placed by **Lee Park** and has **shipped**. I don’t have tracking details or its current location.

Both models made the same two calls with the same arguments. Their answers differ: GPT-6 Luna added that the order is "for Germany", which it inferred from the customer's country rather than from the order. That is why you can't compare models by reading a few replies. You need tasks with answers you can check.


[10]

Step 3: Check every candidate before you run it

A model string names the provider before the colon and the model after it. check_model tells you what a string resolves to and which credentials are missing, without calling the model. This list has one candidate per maker from the tables above:

Pythoncheck_candidates.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
"""Check what each candidate model string needs before you try it. Nothing is called."""
from promptise import check_model

CANDIDATES = [
    "anthropic:claude-opus-5-5",
    "openai:gpt-6.1-sol",
    "gemini:gemini-4-argon",
    "xai:grok-4.7",
    "deepseek:deepseek-v4-pro",
    "mistral:mistral-large-4",
    "openrouter:meta/muse-spark-1.1",
    "openrouter:z-ai/glm-5.3-flash",
    "openrouter:moonshotai/kimi-k3",
    "openrouter:qwen/qwen3.8-max-0902",
    "ollama:qwen3.8:27b",
]

for spec in CANDIDATES:
    check = check_model(spec)
    missing = ", ".join(var.name for var in check.missing_env) or "-"
    print(f"{spec:<34} -> {check.canonical:<38} ok={str(check.ok):<5} missing: {missing}")
Output
anthropic:claude-opus-5-5          -> anthropic:claude-opus-5-5              ok=False missing: ANTHROPIC_API_KEY
openai:gpt-6.1-sol                 -> openai:gpt-6.1-sol                     ok=True  missing: -
gemini:gemini-4-argon              -> google_genai:gemini-4-argon            ok=False missing: GOOGLE_API_KEY
xai:grok-4.7                       -> xai:grok-4.7                           ok=False missing: XAI_API_KEY
deepseek:deepseek-v4-pro           -> deepseek:deepseek-v4-pro               ok=False missing: DEEPSEEK_API_KEY
mistral:mistral-large-4            -> mistralai:mistral-large-4              ok=False missing: MISTRAL_API_KEY
openrouter:meta/muse-spark-1.1     -> openrouter:meta/muse-spark-1.1         ok=False missing: OPENROUTER_API_KEY
openrouter:z-ai/glm-5.3-flash      -> openrouter:z-ai/glm-5.3-flash          ok=False missing: OPENROUTER_API_KEY
openrouter:moonshotai/kimi-k3      -> openrouter:moonshotai/kimi-k3          ok=False missing: OPENROUTER_API_KEY
openrouter:qwen/qwen3.8-max-0902   -> openrouter:qwen/qwen3.8-max-0902       ok=False missing: OPENROUTER_API_KEY
ollama:qwen3.8:27b                 -> ollama:qwen3.8:27b                     ok=True  missing: -

Only OPENAI_API_KEY was set for this run, so every other hosted candidate names its missing variable. Meta, Z.ai, Moonshot AI and Alibaba have no built-in provider in Promptise, so these strings reach them through OpenRouter; you can also call a maker's own OpenAI-compatible endpoint, as the Promptise section below shows. The Ollama string needs no key, and its model part keeps its own colon. On the command line, promptise models check <model> does the same, and --ping adds one real call.


[11]

Step 4: Write tasks with known answers

An eval is a list of questions, the answer each one should get, and a function that checks it. The agent ends every reply with an Answer: line, so a few lines of code can grade it. The script also adds up tokens from each reply's usage data and turns them into dollars with the prices from the provider's page:

Pythoneval_models.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
"""Run the same tool-calling tasks against several models and compare them.

Usage: python eval_models.py openai:gpt-6.1-sol openai:gpt-6-luna ...
"""
import asyncio
import json
import re
import statistics
import sys
import time

from promptise import build_agent
from promptise.config import StdioServerSpec

MODELS = sys.argv[1:] or ["openai:gpt-6-luna"]

# USD per 1M tokens: (input, cached input, output), from developers.openai.com/api/docs/pricing
# on 2026-10-20. Prices change; check them before you rely on the cost column.
PRICES = {
    "openai:gpt-6.1-sol": (2.00, 0.10, 10.00),
    "openai:gpt-6-luna": (0.10, 0.01, 0.50),
    "openai:gpt-5.4-mini": (0.75, 0.075, 4.50),
    "openai:gpt-5.4-nano": (0.20, 0.02, 1.25),
}

INSTRUCTIONS = (
    "You are a shop assistant. Look everything up with your tools; never guess. "
    "End your reply with one line: 'Answer: <value>', where the value is only a number "
    "(no currency sign), a SKU, a two-letter country code or a single word."
)

# Ten tasks with one right answer each: single lookups, a "we can't", chains of
# 2-4 calls, parallel calls, filtering and a little arithmetic.
TASKS = [
    ("What's the status of order A-1005?", "shipped"),
    ("Can we ship a 1 kg parcel to Japan? Answer yes or no.", "no"),
    ("Which country does the customer behind order A-1002 live in?", "PT"),
    ("What is the total of order A-1003 in US dollars?", 542.41),
    ("How many orders has customer C-7 placed, including cancelled ones?", 3),
    ("Which is cheaper per unit, MUG-01 or CUP-02? Answer with the SKU.", "CUP-02"),
    ("How much does it cost to ship a 2.5 kg parcel to the customer of order A-1001?", 7.90),
    ("What is the combined stock of every lamp we sell?", 19),
    ("What is the total value in EUR of customer C-7's orders that were not cancelled?", 538.00),
    ("Customer C-9 wants one floor lamp shipped to them; the parcel weighs 4 kg. "
     "What do they pay in Swiss francs for the lamp plus shipping?", 118.06),
]


def grade(reply: str, expected) -> tuple[bool, str]:
    """Pull the 'Answer:' line out of the reply and compare it with the known answer."""
    found = re.findall(r"answer:\s*(.+)", reply, flags=re.IGNORECASE)
    if not found:
        return False, "(no Answer line)"
    value = found[-1].strip().strip("*`. ")
    if isinstance(expected, str):
        return value.upper() == expected.upper(), value
    number = re.search(r"-?\d[\d,]*\.?\d*", value)
    if number is None:
        return False, value
    return abs(float(number.group().replace(",", "")) - expected) < 0.006, value


async def run_task(agent, prompt: str) -> dict:
    start = time.perf_counter()
    result = await agent.ainvoke({"messages": [{"role": "user", "content": prompt}]})
    seconds = time.perf_counter() - start
    messages = result["messages"]
    usage = [m.usage_metadata for m in messages if getattr(m, "usage_metadata", None)]
    return {
        "seconds": seconds,
        "input_tokens": sum(u["input_tokens"] for u in usage),
        "cached_tokens": sum(u.get("input_token_details", {}).get("cache_read", 0) for u in usage),
        "output_tokens": sum(u["output_tokens"] for u in usage),
        "tool_calls": sum(1 for m in messages if getattr(m, "type", "") == "tool"),
        "reply": messages[-1].text,  # .text joins the text blocks of any provider's reply
    }


def cost(run: dict, model: str) -> float:
    """What one run cost in USD: uncached input, cached input and output tokens times their price."""
    price_in, price_cached, price_out = PRICES.get(model, (0.0, 0.0, 0.0))
    uncached = run["input_tokens"] - run["cached_tokens"]
    return (uncached * price_in + run["cached_tokens"] * price_cached + run["output_tokens"] * price_out) / 1e6


async def evaluate(model: str, log) -> dict:
    agent = await build_agent(
        model=model,
        servers={"shop": StdioServerSpec(command=sys.executable, args=["shop_server.py"])},
        instructions=INSTRUCTIONS,
    )
    runs = []
    try:
        for number, (prompt, expected) in enumerate(TASKS, 1):
            run = await run_task(agent, prompt)
            run["correct"], run["answer"] = grade(run["reply"], expected)
            run.update(model=model, task=number, expected=expected, usd=cost(run, model))
            log.write(json.dumps(run) + "\n")
            runs.append(run)
            mark = "ok  " if run["correct"] else "MISS"
            print(f"{model} task {number:2}: {mark} {run['answer']!r} (expected {expected!r})", flush=True)
    finally:
        await agent.shutdown()
    return {
        "model": model,
        "correct": sum(r["correct"] for r in runs),
        "median_s": statistics.median(r["seconds"] for r in runs),
        "max_s": max(r["seconds"] for r in runs),
        "tokens_in": statistics.mean(r["input_tokens"] for r in runs),
        "tokens_out": statistics.mean(r["output_tokens"] for r in runs),
        "tool_calls": statistics.mean(r["tool_calls"] for r in runs),
        "usd_per_task": statistics.mean(r["usd"] for r in runs),
    }


async def main():
    with open("eval_runs.jsonl", "a") as log:
        summaries = [await evaluate(model, log) for model in MODELS]
    print(f"\n{'model':<22}{'correct':>8}{'median s':>10}{'max s':>7}{'in tok':>8}{'out tok':>8}{'tools':>7}{'$/task':>9}")
    for s in summaries:
        print(
            f"{s['model']:<22}{s['correct']:>5}/10{s['median_s']:>10.1f}{s['max_s']:>7.1f}"
            f"{s['tokens_in']:>8.0f}{s['tokens_out']:>8.0f}{s['tool_calls']:>7.1f}{s['usd_per_task']:>9.4f}"
        )


asyncio.run(main())

What to notice:

  • The model is the only variable. evaluate builds the same agent for each model string.

  • .text reads the reply. GPT-6 models answer through OpenAI's Responses API, where a reply is a list of blocks. message.text joins the text blocks for any provider.

  • Cached input is priced separately. Agents resend the same prefix on every step, and providers bill cached input at a fraction of the price.

  • Every run goes to eval_runs.jsonl, so you can read the reply behind each miss.


[12]

Step 5: Run the tasks across your shortlist

Pass the models you want to compare:

>_Terminal
python eval_models.py openai:gpt-6.1-sol openai:gpt-6-luna openai:gpt-5.4-mini openai:gpt-5.4-nano

This run is OpenAI-only and is not a ranking of model makers. Only an OpenAI key was available, so it compares four OpenAI models on ten easy tasks, once each. It shows the method: the same tasks, the same grader and one changed string per model.

This is the run from October 20, 2026 (all 40 task lines were ok; most are cut here):

Output
openai:gpt-6.1-sol task  1: ok   'shipped' (expected 'shipped')
openai:gpt-6.1-sol task  2: ok   'no' (expected 'no')
openai:gpt-6.1-sol task  3: ok   'PT' (expected 'PT')
…
openai:gpt-5.4-nano task 10: ok   '118.06' (expected 118.06)

model                  correct  median s  max s  in tok out tok  tools   $/task
openai:gpt-6.1-sol       10/10       5.9    9.6    1175      71    2.4   0.0031
openai:gpt-6-luna        10/10       5.4    8.8    1201     110    2.4   0.0002
openai:gpt-5.4-mini      10/10       3.2    5.3    1452      65    2.4   0.0014
openai:gpt-5.4-nano      10/10       3.6    8.4    1536      92    2.6   0.0004

OpenAI now marks gpt-5.4-nano as deprecated. For your own run, take the shortlist from the tables above and add each model's prices to PRICES.


[13]

Step 6: Read the results, not just the score

All four models answered every task, and that is the first lesson: this eval is too easy to separate them. Add the questions your agent gets wrong in production until the scores spread out: dead ends, such as a product that doesn't exist, tasks that need five or more calls, and conversations where the user changes their mind.

The other columns already tell the models apart:

  • Cost per task. GPT-6.1 Sol cost $0.0031 per task, and GPT-6 Luna $0.0002. If both pass your harder tasks too, Luna is the better choice at more than 15 times lower cost.

  • Latency. gpt-5.4-mini had the lowest median, at 3.2 seconds per task. The GPT-6 models took longer per task even with fewer input tokens. For a chat interface, the slow tail (max s) matters as much as the median.

  • Tool calls. All four averaged between 2.4 and 2.6 calls per task, so none of them wandered. A model that needs many more calls than the others is guessing.

Run each task several times before you trust a result, because models are not deterministic. How to evaluate AI agents covers repeated runs, pass^k and LLM judges.


[14]

The complete example

The project has four files:

Text
model-eval/
├── shop_server.py        # MCP server with seven tools and fixed data (step 1)
├── agent.py              # one agent; the model comes from AGENT_MODEL (step 2)
├── check_candidates.py   # what each model string needs, no calls (step 3)
└── eval_models.py        # ten tasks, grading, tokens, latency and cost (steps 4-5)
>_Terminal
pip install "promptise>=1.4.3"
export OPENAI_API_KEY="sk-..."           # plus ANTHROPIC_API_KEY, OPENROUTER_API_KEY, ... for others
python check_candidates.py               # see what each candidate still needs
python eval_models.py openai:gpt-6.1-sol anthropic:claude-sonnet-5-5 openrouter:meta/muse-spark-1.1 openrouter:z-ai/glm-5.3-flash

Add each model's prices to PRICES before you compare costs; a model missing from it shows a cost of 0.


[15]

Where does Promptise fit in choosing a model?

Promptise Foundry is an agent framework, not a model. It doesn't rank or host models. It keeps the model out of your agent code, so the comparison above is cheap to run and the winner is cheap to adopt.

One string per model. Your tools stay on MCP servers, so they don't change with the model. These are the strings for the models in this guide's picks:

Model

Promptise model string

Muse Spark 1.1, Muse Spark 1.2 (Meta)

openrouter:meta/muse-spark-1.1, openrouter:meta/muse-spark-1.2

Claude Opus 5.5, Sonnet 5.5, Haiku 5.5, Fable 5.1 (Anthropic)

anthropic:claude-opus-5-5, anthropic:claude-sonnet-5-5, anthropic:claude-haiku-5-5, anthropic:claude-fable-5-1

Claude Opus 5, Opus 4.8 (Anthropic)

anthropic:claude-opus-5, anthropic:claude-opus-4-8

GPT-6 Astra, GPT-6.1 Sol, GPT-6 Luna (OpenAI)

openai:gpt-6-astra, openai:gpt-6.1-sol, openai:gpt-6-luna

Gemini 4 Argon (Google)

gemini:gemini-4-argon

GLM-5.3, GLM-5.3-Flash (Z.ai)

openrouter:z-ai/glm-5.3, openrouter:z-ai/glm-5.3-flash

Qwen3.8-Max (Alibaba)

openrouter:qwen/qwen3.8-max-0902

Kimi K3 (Moonshot AI)

openrouter:moonshotai/kimi-k3

DeepSeek V4 Pro, V4.1 Flash (DeepSeek)

deepseek:deepseek-v4-pro, deepseek:deepseek-flash

Grok 4.7 (SpaceXSI)

xai:grok-4.7

Mistral Large 4 (Mistral)

mistral:mistral-large-4

A local model through Ollama

ollama:qwen3.8:27b

The rest of the model layer:

  • Any OpenAI-compatible endpoint. Model("muse-spark-1.1", provider="openai", endpoint="https://api.meta.ai/v1", api_key=...) calls Meta's own API, with the key from a secret manager instead of the environment. The same pattern reaches any maker without a built-in provider.

  • A fallback chain. FallbackChain tries the next model when one fails or times out, with a circuit breaker per model.

  • A preflight check. check_model and promptise models check say what is missing before a deploy.

A second provider as a fallback is one more string. The best local LLM guide runs this pattern with real output:

Python
1
2
3
4
5
6
from promptise import FallbackChain, build_agent

agent = await build_agent(
    model=FallbackChain(["openai:gpt-6.1-sol", "anthropic:claude-sonnet-5-5"], timeout_per_model=60),
    servers=servers,
)

Where other tools fit better: for a coding assistant rather than an agent of your own, use one of the makers' coding agents behind the Terminal-Bench scores, such as Claude Code, Codex, Grok Build or Muse Code. For a provider's hosted tools, such as built-in web search, the provider's own SDK exposes them directly; Promptise drives the tools you serve over MCP.


[16]

Running it in production

Pin the model and rerun the eval when it changes

Use the exact model ID, not an alias that moves, and keep the eval in your repository. When a provider ships a new version, change the string, run the eval, and compare the columns before you deploy. AI agent evals in CI shows how to run it on every pull request.

Add a fallback provider

Providers have outages and rate limits. A FallbackChain with models from two providers keeps the agent answering. Run your eval on the fallback model too, because it will make different tool choices. LLM semantic cache and model fallback covers the chain, timeouts and caching in detail.

Track cost per task in production

Cost per task depends on your traffic: steps, history length and cache hits. Record tokens per run and per user as AI agent cost tracking shows.


[17]

Common problems and fixes

Symptom

Cause

Fix

Every model scores 100%

The tasks are too easy to separate them

Add production failures, dead ends and longer chains of calls

The agent answers in prose and never calls a tool

The model or endpoint has no tool calling

Pick a tool-capable model. For self-hosted servers, turn on the tool-call parser

The Answer: regex finds nothing on GPT-6 models

The Responses API returns a list of content blocks

Read message.text, not message.content

ModelSetupError naming a variable

The provider's key is not set

Set it, or run promptise models check <model> to see what is missing

A cheap model costs more than expected

More steps, retries or reasoning tokens per task

Compare cost per task from the eval, not price per token

Your results disagree with a leaderboard

Different harness, effort setting or tools

Trust your tasks for your agent; use boards to build the shortlist


[18]

Limitations

  • The picks are a snapshot of public boards and maker pages on October 21, 2026. Boards lag new releases, and some prices are introductory: Gemini 4 Argon's rises on December 1, 2026, and Gemini 3.8 Flash's on January 1, 2027.

  • The newest models have no independent tool-use scores yet. Claude Opus 5.5 and Sonnet 5.5, the GPT-6 models, Gemini 4 Argon, Muse Spark 1.3 and Muse Wonder appear on terminal and general boards only.

  • Board leads are small. Most first places are within the ± range of the next models, and MCPMark Verified, τ-bench and Artificial Analysis publish no range at all.

  • The test run is small and OpenAI-only. It used ten tasks, one run each, and four OpenAI models, because only an OpenAI key was available. The other makers' models are configured and checked, not run.

  • Promptise doesn't benchmark models. It makes your own eval easy to run and the result easy to switch to.


[19]

Frequently asked questions

What is the best LLM for AI agents right now?

No single model is best on October 21, 2026. Meta's Muse Spark 1.1 leads MCP-Atlas at 88.1, with Claude Fable 5.1, Claude Opus 5, Qwen3.8 and GLM-5.3 inside its margin. GLM-5.3-Flash leads Toolathlon-Verified, and Claude Opus 5.5 leads Terminal-Bench 4.0 with Claude Code. Take two or three models from the use-case table: the best LLM for your agent is the cheapest one that passes your own tool-calling tasks.

Which LLM has the best function calling for agents?

On MCP-Atlas, which tests workflows over 36 real MCP servers, five models are tied at the top: Muse Spark 1.1 (88.1), Claude Fable 5.1 (87.2), Claude Opus 5 (85.8), Qwen3.8-2.4T-A95B (84.5) and GLM-5.3 (84.2). GLM-5.3-Flash leads Toolathlon-Verified at 78.4, and Kimi K3 leads MCPMark Verified at 96.06%. BFCL, the classic function-calling benchmark, has no model released in 2026.

Is Claude or GPT better for AI agents?

It depends on the board and the harness. On Terminal-Bench 4.0 with each maker's own agent, Claude Opus 5.5 (64.8%) leads GPT-6 Astra and GPT-6.1 Sol (both 58.2%). With one agent for every model, Opus 5.5 and GPT-6 Astra tie at 59.6%, Claude Sonnet 5.5 scores 63.6% and GPT-6.1 Sol 56.1%. On MCPMark Verified, GPT-5.5 and GPT-5.6 Sol (92.91%) lead Claude Fable 5 (86.61%). Models from Meta, Alibaba and Z.ai are as strong on the tool-use boards, so test a mixed shortlist on your own tasks.

What is the best open-source LLM for agents?

Several open-weight models lead tool-use boards. GLM-5.3-Flash (MIT license, 18 billion active parameters) leads Toolathlon-Verified at 78.4, with Kimi K3 at 76.5. On MCP-Atlas, Qwen3.8-2.4T-A95B (84.5) and GLM-5.3 (84.2) are in the top group, and DeepSeek V4 Pro 0813 (MIT) scores 74.4 on Toolathlon-Verified. Kimi K3, Qwen3.8 and GLM-5.3 use their makers' own licenses, so read them first. All of these need multi-GPU servers to self-host; for models that run on one GPU or a Mac, see the best local LLM for AI agents.

What is the cheapest LLM that works for agents?

GPT-6 Luna and Claude Haiku 5.5 cost $0.10 per million input tokens and $0.50 per million output tokens, and GLM-5.3-Flash costs $0.15 and $0.50; Haiku's price rises above 100K-token prompts. On Artificial Analysis's Terminal-Bench 4.0 run, Haiku 5.5 and GLM-5.3-Flash score 32.8% and Luna 12.6%, and GLM-5.3-Flash also leads Toolathlon-Verified. Use small models for short steps and check them on your longest tasks.

Which LLM is best to help me build my first agent?

Use a mid-price model you already have access to, such as Claude Sonnet 5.5, GPT-6.1 Sol or Gemini 4 Argon, for both writing the code and running the agent. On Artificial Analysis's Terminal-Bench 4.0 run, where every model uses the same agent, Sonnet 5.5 scores 63.6%, Gemini 4 Argon 57.1% and GPT-6.1 Sol 56.1%, a few tasks apart, and all three cost $2 / $10 per million tokens (Gemini's price until November 30, 2026). Ask it to draft the system prompt and tools, then test the agent on a few tasks with known answers before you change anything.

Does Promptise work with all of these models?

Yes. Promptise has built-in providers for OpenAI, Anthropic, Google Gemini, Grok (xai:), DeepSeek, Mistral, OpenRouter, Ollama and others, all with pip install promptise. Makers without a built-in provider, such as Meta, Moonshot AI, Z.ai and Alibaba, work through OpenRouter or through Model(..., provider="openai", endpoint=...) pointed at their OpenAI-compatible API. Run promptise models check <model> to see what a provider still needs.


[20]

Next steps

  • Run open-weight models on your own hardware: the best local LLM for AI agents and Ollama AI agent with MCP.

  • Try many providers behind one key: OpenRouter AI agent with MCP.

  • Mix small and large models: LLM routing: when to use a small vs large model.

  • Keep the agent up when a provider fails: LLM semantic cache and model fallback.

  • Grow the eval: how to evaluate AI agents.

  • Reference: Models and providers and model fallback in the Promptise docs.

Contents

  1. 01What is the best LLM for AI agents in 2026?
  2. 02How do the best LLMs for agentic AI compare?
  3. 03What makes a good agent LLM?
  4. 04Which LLM has the best function calling for agents?
  5. 05When to use a small, cheap or open-weight model (and when not)
  6. 06Which model should you use to write agent prompts and code?
  7. 07What you need to test models on your own tools
  8. 08Step 1: Put your tools in an MCP server
  9. 09Step 2: Make the model a setting
  10. 10Step 3: Check every candidate before you run it
  11. 11Step 4: Write tasks with known answers
  12. 12Step 5: Run the tasks across your shortlist
  13. 13Step 6: Read the results, not just the score
  14. 14The complete example
  15. 15Where does Promptise fit in choosing a model?
  16. 16Running it in production
  17. 17Common problems and fixes
  18. 18Limitations
  19. 19Frequently asked questions
  20. 20Next steps

Learning paths

Want more structure? Paths put guides in order, like a short course.

See the paths →

> Building AI agents in Python

Related guides

All guides in this topic →
  • // 01Intermediate · 18 minAI Agent YAML: Define and Run an Agent From a Config FileDefine an AI agent in a YAML file: model, instructions and MCP servers. Validate it, run it from the CLI or Python, keep secrets out, review it in Git.
  • // 02Intermediate · 14 minStreaming LLM Responses with FastAPI: Tokens and Tool CallsStream an AI agent's tool calls and answer from FastAPI to a web page with Server-Sent Events, with cancellation, errors and an EventSource page.
  • // 03Beginner · 7 minWhat Is an AI Agent? Definition, How It Works, ExamplesWhat an AI agent is: a model that calls tools in a loop until a goal is met. How the loop works, a real example, agents vs chatbots and workflows, FAQs.
  • // 04Beginner · 20 minHow to Build an AI Agent in Python (2026 Guide)Build an AI agent in Python step by step: write the tool loop, serve tools over MCP, add model fallback, approvals and limits. Runnable code, real output.
  • // 05Beginner · 14 minReAct Agent Pattern: Tool Execution Loop Explained SimplyThe ReAct agent pattern explained simply: what an agent does after it calls a tool, a loop written by hand, the same agent in Promptise, where it breaks.
  • // 06Intermediate · 25 minBuild a Personal AI Agent: Memory, Reminders, ChatBuild a personal AI agent you host: chat over a signed webhook, memory that survives restarts, and reminders on a cron trigger, with runnable code.

Keep going.

Browse every guide by topic and level, or follow a learning path that puts them in order.

All guidesLearning paths