← All tasks

Best LLM for Agents & Tool Use in 2026

For agents & tool use, Muse Spark 1.3 Contributor is our pick: $0.12/M tokens on a Multi-step agent task workload, 1.0M context.

Agent loops chain many model calls together, so both correctness and throughput compound — a slow or wrong step early in the loop is expensive downstream. We require a reasoning mode and weight speed almost as heavily as evidence.

Verdict: Throughput matters more here than on any other task page — an agent loop calls the model repeatedly, so tokens/sec compounds in a way a single chat turn never does.

Quick answer: What is the best LLM for agentic tool use?

Muse Spark 1.3 Contributor, from Meta, is the best fit for agents & tool use at $0.12 per million task tokens on a Multi-step agent task workload, with a 1.0M-token context window. No cheaper value pick beats it for this task.

Verified 2026-08-08
Best overall
Muse Spark 1.3 Contributor
Meta · $0.12/M
Fit 91/100 — the top requirements match for this task.
Best value
Muse Spark 1.3 Contributor
Meta · $0.12/M
The strongest fit among budget and mid-tier priced models.
Fastest
GPT-OSS 120B (Cerebras)
Cerebras · $0.43/M
2450 tokens/sec measured.
Longest context
Gemini 3.1 Pro
Google · $4.00/M
2M token context window.

What evidence supports the Agents & Tool Use recommendation?

Graded on 3 of 28 eligible models, run 2026-06-21. Full prompts, verbatim outputs, and grading notes below.

Median of Two Sorted Arrays in O(log n)

A classic hard algorithm: compute the median of two sorted lists in O(log(min(m,n))) time. A merge is explicitly disallowed, so the model must implement the tricky binary-search partition correctly — including empty-list and even/odd edge cases — and return code only.

Click Accuracy, Speed, or Cost to re-sort. Click any row to read the full model output.
Per-model results: accuracy, speed (tokens/sec), provider cost (USD), and the full prompt-vs-output for each model on this task.
#ModelAccuracy Speed Cost Output
Agent grade — 100/100. Passes all 5,000+ randomized cases and every edge case; genuine O(log(min(m,n))) partition search, returns a float, code-only, and explicitly raises on two empty lists. Correct — but the slowest run by far (over three minutes), and now that real usage is reported, comfortably the most expensive.
Verbatim output (152 in / 548 out tokens, 206116 ms, $0.1032)
```python
from math import inf
from typing import Sequence


def median_of_two_sorted(a: Sequence[float], b: Sequence[float]) -> float:
    if len(a) > len(b):
        a, b = b, a

    n, m = len(a), len(b)
    if n == 0 and m == 0:
        raise ValueError("median is undefined for two empty lists")

    total = n + m
    half = (total + 1) // 2

    left, right = 0, n
    while left <= right:
        i = (left + right) // 2
        j = half - i

        left_a = -inf if i == 0 else a[i - 1]
        right_a = inf if i == n else a[i]

        left_b = -inf if j == 0 else b[j - 1]
        right_b = inf if j == m else b[j]

        if left_a <= right_b and left_b <= right_a:
            if total % 2 == 1:
                return float(max(left_a, left_b))
            return float((max(left_a, left_b) + min(right_a, right_b)) / 2.0)

        if left_a > right_b:
            right = i - 1
        else:
            left = i + 1

    raise ValueError("input lists must be sorted in non-decreasing order")
```
Agent grade — 100/100. Passes all 5,000+ randomized cases and every edge case; genuine O(log(min(m,n))) partition, float return, code-only. The fastest correct solution in this task.
Verbatim output (220 in / 382 out tokens, 3790 ms, $0.01065)
```python
def median_of_two_sorted(a, b):
    # Ensure a is the smaller list
    if len(a) > len(b):
        a, b = b, a

    m, n = len(a), len(b)
    total = m + n
    half = (total + 1) // 2

    lo, hi = 0, m
    while lo <= hi:
        i = (lo + hi) // 2  # elements taken from a
        j = half - i        # elements taken from b

        a_left = a[i - 1] if i > 0 else float('-inf')
        a_right = a[i] if i < m else float('inf')
        b_left = b[j - 1] if j > 0 else float('-inf')
        b_right = b[j] if j < n else float('inf')

        if a_left <= b_right and b_left <= a_right:
            if total % 2 == 1:
                return float(max(a_left, b_left))
            else:
                return (max(a_left, b_left) + min(a_right, b_right)) / 2.0
        elif a_left > b_right:
            hi = i - 1
        else:
            lo = i + 1

    raise ValueError("Input lists are not sorted or invalid")
```
Agent grade — 100/100. Passes all 5,000+ randomized cases and every edge case with a genuine O(log) partition and float return. The <think> block ahead of the code is GLM's reasoning channel surfaced by our gateway, not reasoning dumped into the answer — GLM's actual content is the clean code block — so it scores level with the other correct solutions, as the cheapest of them.
Verbatim output (158 in / 2148 out tokens, 47713 ms, $0.009672)
<think>
We need to write a Python function `median_of_two_sorted(a, b)` that returns the median of two sorted lists in O(log(min(len(a), len(b)))) time. The function should handle empty lists, return float, and for even total return average of two middle values, for odd return the single middle value.

We must implement the classic binary search on the smaller array. The algorithm: ensure a is the smaller array. Let m = len(a), n = len(b). We want to partition a and b such that left half contains elements <= right half. We binary search on partition index i in a (0 to m). Then j = (m + n + 1) // 2 - i. We need to ensure that a[i-1] <= b[j] and b[j-1] <= a[i] (with boundary checks). If condition holds, we found the correct partition. Then if total length is odd, median is max of left half. If even, median is (max(left) + min(right)) / 2.0.

Edge cases: empty arrays. If a is empty, median is just median of b. If b is empty, median of a. But the algorithm should handle it if we set a as the smaller array. If a is empty, m=0, then i=0, j = (0+n+1)//2 = (n+1)//2. Then we need to check conditions: a[i-1] doesn't exist, so we treat as -inf. b[j-1] <= a[i] (a[i] doesn't exist, treat as inf). So condition holds. Then left max is b[j-1] (if j>0) else -inf. Right min is b[j] (if j<n) else inf. Then compute median. This works.

We must return float. For odd total, return float(median). For even, return average as float.

Implementation details: Use integer indices. Use float('inf') and float('-inf') for boundaries.

Let's write the code.

```python
def median_of_two_sorted(a, b):
    # Ensure a is the smaller array
    if len(a) > len(b):
        a, b = b, a
    m, n = len(a), len(b)
    # Binary search on a
    low, high = 0, m
    while low <= high:
        i = (low + high) // 2
        j = (m + n + 1) // 2 - i
        # Get left and right elements with boundaries
        a_left = a[i-1] if i > 0 else float('-inf')
        a_right = a[i] if i < m else float('inf')
        b_left = b[j-1] if j > 0 else float('-inf')
        b_right = b[j] if j < n else float('inf')
        
        if a_left <= b_right and b_left <= a_right:
            # Found correct partition
            if (m + n) % 2 == 1:
                return float(max(a_left, b_left))
            else:
                return (max(a_left, b_left) + min(a_right, b_right)) / 2.0
        elif a_left > b_right:
            # i is too large, need to decrease i
            high = i - 1
        else:
            # b_left > a_right, need to increase i
            low = i + 1
    # Should never reach here if inputs are sorted
    raise ValueError("Input lists are not sorted or invalid.")
```

Check: For odd total, (m+n+1)//2 gives the size of left half (larger half). For even, left half size = (m+n)//2. The formula j = (m+n+1)//2 - i works for both: if total odd, left half has one more element, so j = (total+1)//2 - i. If total even, (total+1)//2 = total//2 (since total even, total+1 odd, integer division gives total//2). So j = total//2 - i. That's correct.

Test with examples:
a = [1, 3], b = [2] -> m=2, n=1. a is larger? Actually len(a)=2, len(b)=1, so we swap: a=[2], b=[1,3]. m=1, n=2. low=0, high=1. i=0: j=(1+2+1)//2 - 0 = 4//2=2. a_left=-inf, a_right=2, b_left=b[1]=3, b_right=inf. Check: a_left <= b_right (-inf <= inf) true. b_left <= a_right? 3 <= 2 false. So b_left > a_right, need to increase i. low=1. i=1: j=2-1=1. a_left=a[0]=2, a_right=inf, b_left=b[0]=1, b_right=b[1]=3. Check: 2<=3 true, 1<=inf true. Found. total=3 odd. max(2,1)=2. return 2.0. Correct.

a = [1, 2], b = [3, 4] -> m=2, n=2. low=0, high=2. i=1: j=(4+1)//2 -1 = 2-1=1. a_left=1, a_right=2, b_left=3, b_right=4. Check: 1<=4 true, 3<=2 false. b_left > a_right, increase i. low=2. i=2: j=2-2=0. a_left=2, a_right=inf, b_left=-inf, b_right=3. Check: 2<=3 true, -inf<=inf true. Found. total=4 even. max(2, -inf)=2, min(inf, 3)=3. avg=2.5. Correct.

Empty a: a=[], b=[1,2,3]. m=0, n=3. low=0, high=0. i=0: j=(0+3+1)//2 -0 = 4//2=2. a_left=-inf, a_right=inf, b_left=b[1]=2, b_right=b[2]=3. Check: -inf<=3 true, 2<=inf true. Found. total=3 odd. max(-inf,2)=2. return 2.0. Correct.

Empty both? Not specified but if both empty, m=0,n=0. low=0, high=0. i=0: j=(0+0+1)//2 -0 = 0. a_left=-inf, a_right=inf, b_left=-inf, b_right=inf. Check: -inf<=inf true, -inf<=inf true. Found. total=0 even? (0%2==0). max(-inf,-inf)=-inf, min(inf,inf)=inf. avg = (-inf+inf)/2 = nan. But problem likely assumes at least one element? Usually median of empty is undefined. We could handle by returning 0.0 or raising error. But requirements say "Handle the case where one list is empty." It doesn't mention both empty. We can leave as is, or add a check: if m==0 and n==0: return 0.0. But to be safe, we can just let it return nan, but better to handle. Since it's not specified, we can assume at least one list non-empty. But to be robust, we can add: if m == 0 and n == 0: return 0.0. However, the problem says "Handle the case where one list is empty." So both empty might not be tested. I'll include a check for both empty returning 0.0 or maybe raise ValueError. But the instruction says "Return ONLY the code inside a single Python code block, with no explanation." So we just provide the function. I'll add a guard: if not a and not b: return 0.0. But that might be unnecessary. Let's keep it simple.

Also, we need to ensure we return float. In Python, division / returns float. For odd case, we return float(max(...)). That's fine.

Time complexity: O(log(min(m,n))) because we binary search on the smaller array. Space O(1).

Let's write the final code block.
</think>
```python
def median_of_two_sorted(a, b):
    # Ensure a is the smaller array for O(log(min(m, n))) complexity
    if len(a) > len(b):
        a, b = b, a
    m, n = len(a), len(b)
    
    # Edge case: both empty (not required, but safe)
    if m == 0 and n == 0:
        return 0.0
        
    low, high = 0, m
    while low <= high:
        i = (low + high) // 2
        j = (m + n + 1) // 2 - i
        
        a_left = a[i - 1] if i > 0 else float('-inf')
        a_right = a[i] if i < m else float('inf')
        b_left = b[j - 1] if j > 0 else float('-inf')
        b_right = b[j] if j < n else float('inf')
        
        if a_left <= b_right and b_left <= a_right:
            if (m + n) % 2 == 1:
                return float(max(a_left, b_left))
            else:
                return (max(a_left, b_left) + min(a_right, b_right)) / 2.0
        elif a_left > b_right:
            high = i - 1
        else:
            low = i + 1
            
    raise ValueError("Input lists are not sorted or invalid.")
```
Agent grade — 99/100. Passes all tests with a clean, minimal O(log) partition and float return, code-only. Docked one point only because two empty lists yield NaN rather than an explicit guard (not required by the prompt).
Verbatim output (164 in / 320 out tokens, 17413 ms, $0.004168)
```python
def median_of_two_sorted(a, b):
    if len(a) > len(b):
        a, b = b, a
        
    m, n = len(a), len(b)
    low, high = 0, m
    
    while low <= high:
        partitionA = (low + high) // 2
        partitionB = (m + n + 1) // 2 - partitionA
        
        maxLeftA = float('-inf') if partitionA == 0 else a[partitionA - 1]
        minRightA = float('inf') if partitionA == m else a[partitionA]
        
        maxLeftB = float('-inf') if partitionB == 0 else b[partitionB - 1]
        minRightB = float('inf') if partitionB == n else b[partitionB]
        
        if maxLeftA <= minRightB and maxLeftB <= minRightA:
            if (m + n) % 2 == 1:
                return float(max(maxLeftA, maxLeftB))
            else:
                return (max(maxLeftA, maxLeftB) + min(minRightA, minRightB)) / 2.0
        elif maxLeftA > minRightB:
            high = partitionA - 1
        else:
            low = partitionA + 1
```
Full test output, prompt, and grading notes →

Reproducible Agents & Tool Use evidence and decision rubric

Test / runPrompt and verificationHard rule
Code Snippetexact prompt + 20 recorded runsCorrect iterative algorithm and code-only output
Hard Algorithmexact prompt + 4 recorded runs5,000-case harness; O(log n) partition and correct edge cases

Run dates: budget suite 2026-06-16T20:31:30.728Z; premium suite 2026-06-21T00:00:00.000Z. Results are not a claim about every repository or prompt.

Two-test rubric, failure analysis, and task-shaped ranking

ModelAccuracyLatencyOutput tokensRun costFailure / qualification note
GPT-5.4 Pro100/100206116 ms548$0.103Passes all 5,000+ randomized cases and every edge case; genuine O(log(min(m,n))) partition search, returns a float, code-only, and explicitly raises on two empty lists. Correct — but the slowest run by far (over three minutes), and now that real usage is reported, comfortably the most expensive.
Claude Opus 4.8100/1003790 ms382$0.011Passes all 5,000+ randomized cases and every edge case; genuine O(log(min(m,n))) partition, float return, code-only. The fastest correct solution in this task.
GLM 5.2 (Max)100/10047713 ms2148$0.010Passes all 5,000+ randomized cases and every edge case with a genuine O(log) partition and float return. The <think> block ahead of the code is GLM's reasoning channel surfaced by our gateway, not reasoning dumped into the answer — GLM's actual content is the clean code block — so it scores level with the other correct solutions, as the cheapest of them.
Gemini 3.1 Pro99/10017413 ms320$0.004Passes all tests with a clean, minimal O(log) partition and float return, code-only. Docked one point only because two empty lists yield NaN rather than an explicit guard (not required by the prompt).

Availability caveat: short code tests do not establish repository-scale debugging, multi-file tool use, or agent reliability. The fastest acceptable verdict must therefore clear the correctness rule before speed is considered.

Task-shaped cost ranking (20,000 tasks/month)

RankModelEffective monthlyMeasured verbosity
1Amazon Nova Micro$18.260.76×
2Amazon Nova Lite$32.740.91×
3GPT-5 Nano$36.00Unavailable; neutral fallback
4Gemini 2.5 Flash Lite$56.00Unavailable; neutral fallback
5GPT-OSS 20B$65.162.93×
6Ministral 8B$65.580.93×

Verified 2026-08-08. full prompt/run evidence

Try these models for Agents & Tool Use

Volume, requirement-gate, and pricing cross-check for Agents & Tool Use

Monthly spend ladder at Multi-step agent task shape

Calls / monthOverall pick monthlyBudget pick monthlyOverall − budget delta
15,000$13.50$13.50$0.0000
30,000$27.00$27.00$0.0000
60,000$54.00$54.00$0.0000
150,000$135.00$135.00$0.0000

Monthly cost = task price/M × (6,000 input + 1,500 output tokens) × calls ÷ 1,000,000, at 0.5×, 1×, 2×, 5× the published 30,000-call/month baseline.

Requirement-gate margin for the picked models

ModelRequirementMeasured valueMargin / result
Muse Spark 1.3 ContributorReasoning mode requiredReasoning mode presentGate passed
Muse Spark 1.3 ContributorReasoning mode requiredReasoning mode presentGate passed
GPT-OSS 120B (Cerebras)Reasoning mode requiredReasoning mode presentGate passed

Requirement gates are hard filters, not down-ranking: a model failing any row here is excluded from Agents & Tool Use candidates entirely, regardless of price or speed.

Pricing-page cross-link for each pick

ModelTask-weighted $/MMonthly at published volumeMeasured throughput
Muse Spark 1.3 Contributor$0.12$27.00Unavailable
GPT-OSS 120B (Cerebras)$0.43$96.752450 tok/s
Gemini 3.1 Pro$4.00$900.0055 tok/s

Evidence coverage: 3 of 28 candidates have a graded run, run on 2026-06-21T00:00:00.000Z.

Test the Agents & Tool Use picks side by side →

Verified 2026-08-08. "Unavailable" means no compatible dated evidence was found for that field; it is never treated as zero. Dated source · Full ranking and rubric

Batch 10 agent-loop decision depth

1. Loop-success compounding (scenario only)

Steps nPer-step success pFormula: P(loop success)Calculated result
50.90(0.90)^50.5905
100.90(0.90)^100.3487
200.90(0.90)^200.1216
50.95(0.95)^50.7738
100.95(0.95)^100.5987
200.95(0.95)^200.3585
50.98(0.98)^50.9039
100.98(0.98)^100.8171
200.98(0.98)^200.6676

p values 0.90, 0.95, and 0.98 are explicit User-supplied scenarios; independence is also User-supplied.

2. Serial versus branched execution envelope

Branch pathsCalls / pathSerial workBranched wall clockFormula / boundary
13UnavailableUnavailable3 serial calls/path; critical path is independent of branch count
23UnavailableUnavailable3 serial calls/path; critical path is independent of branch count
43UnavailableUnavailable3 serial calls/path; critical path is independent of branch count

Serial work = paths × 3 × (TTFT + output tokens ÷ tok/s); branched wall clock assumes all paths run concurrently. Tool latency, orchestration, and quality are Unavailable.

3. Cheap-first escalation crossover

EscalationDirect premium baselineCheap candidatePremium candidateBlended token cost / attemptEstimated wall clock
0%$0.07Muse Spark 1.3 ContributorClaude Opus 4.8$0.0009Unavailable
10%$0.07Muse Spark 1.3 ContributorClaude Opus 4.8$0.0078Unavailable
25%$0.07Muse Spark 1.3 ContributorClaude Opus 4.8$0.02Unavailable
50%$0.07Muse Spark 1.3 ContributorClaude Opus 4.8$0.04Unavailable

Named scenario: 1-step cheap success costs one cheap call; 3-step cheap + 1-step premium escalation costs three cheap calls plus one premium call. The 6K input + 1.5K output shape is the agent task workload; escalation success probability is User-supplied.

Stale-data behavior: dated registry values are snapshots. If a source is older than the page verification date, or a provider changes its policy/pricing/model, re-verify before production use; unknown values remain Unavailable.

Verified 2026-08-08. Luna is the data owner. “Unavailable” means no compatible dated evidence was found; it is never zero, an estimate, or a guessed policy. Stale-data behavior: dated registry values are snapshots. If a source is older than the page verification date, or a provider changes its policy/pricing/model, re-verify before production use; unknown values remain Unavailable. Dated registry source · Run this scenario yourself →

Batch 59 · server-rendered evidence boards · verified 2026-09-07

Intent answer: Agentic workflows require strict function call syntax, reliable tool-chain execution, multi-step planning, and resilient self-correction upon receiving error feedback. Frontier reasoners and specialized tool models dominate this frontier. Verified 2026-09-07.

Demand evidence: Qualitative demand: agentic benchmark rankings and tool-use leaderboards reviewed 2026-09-07; exact US monthly volume is unavailable.

Scope boundary: Evaluate and rank the best AI models for agentic tool use, multi-step autonomous loops, function calling accuracy, and error recovery. Exact joins required; unresolved joins render Unavailable.

Multi-step tool invocation fidelity register

Deterministic formula / rule: tool_fidelity = successful_tool_calls / (tool_calls + syntax_errors + invalid_arguments); multi-turn test.

Boundary: Owns agentic tool-use evaluation across models.

Frozen scenario / field IDExact identity and evidence fieldsResultState
batch59-task-agents-m1-r1
single search tool invocation
route=$/best-llm-for/agents; owner=$task-agents; scenario=$single search tool invocation; model ID; valid tool-call rate %; parallel execution accuracy %; argument parsing fidelity %; hallucinated tool rate %; agent ranking tier; verified=2026-09-07Unavailable — frozen task-agents fixture requires an exact source, identity, and result receiptUNTESTED — module 1 rule is reproducible but no production observation is claimed
batch59-task-agents-m1-r2
parallel multi-tool call (3 tools)
route=$/best-llm-for/agents; owner=$task-agents; scenario=$parallel multi-tool call (3 tools); model ID; valid tool-call rate %; parallel execution accuracy %; argument parsing fidelity %; hallucinated tool rate %; agent ranking tier; verified=2026-09-07Unavailable — frozen task-agents fixture requires an exact source, identity, and result receiptUNTESTED — module 1 rule is reproducible but no production observation is claimed
batch59-task-agents-m1-r3
nested argument schema tool call
route=$/best-llm-for/agents; owner=$task-agents; scenario=$nested argument schema tool call; model ID; valid tool-call rate %; parallel execution accuracy %; argument parsing fidelity %; hallucinated tool rate %; agent ranking tier; verified=2026-09-07Unavailable — frozen task-agents fixture requires an exact source, identity, and result receiptUNTESTED — module 1 rule is reproducible but no production observation is claimed
batch59-task-agents-m1-r4
multi-turn error recovery loop
route=$/best-llm-for/agents; owner=$task-agents; scenario=$multi-turn error recovery loop; model ID; valid tool-call rate %; parallel execution accuracy %; argument parsing fidelity %; hallucinated tool rate %; agent ranking tier; verified=2026-09-07Unavailable — frozen task-agents fixture requires an exact source, identity, and result receiptUNTESTED — module 1 rule is reproducible but no production observation is claimed
batch59-task-agents-m1-r5
hallucinated tool name refusal
route=$/best-llm-for/agents; owner=$task-agents; scenario=$hallucinated tool name refusal; model ID; valid tool-call rate %; parallel execution accuracy %; argument parsing fidelity %; hallucinated tool rate %; agent ranking tier; verified=2026-09-07Unavailable — frozen task-agents fixture requires an exact source, identity, and result receiptUNTESTED — module 1 rule is reproducible but no production observation is claimed
batch59-task-agents-m1-r6
unsupported tool parameter
route=$/best-llm-for/agents; owner=$task-agents; scenario=$unsupported tool parameter; model ID; valid tool-call rate %; parallel execution accuracy %; argument parsing fidelity %; hallucinated tool rate %; agent ranking tier; verified=2026-09-07Unavailable — exact task-agents evidence join is not closed for "unsupported tool parameter"FAIL CLOSED — manual, probe, or source evidence required

First-party citation: All AI Ask model specifications. Verified 2026-09-07; missing or conflicting joins fail closed.

Agentic loop iteration cost & token multiplier

Deterministic formula / rule: loop_cost = sum_{turn=1}^N (context_turn * in_rate + thought_and_call * out_rate); compounding context.

Boundary: Owns compounding context cost modeling in agent loops.

Frozen scenario / field IDExact identity and evidence fieldsResultState
batch59-task-agents-m2-r1
3-turn web research loop
route=$/best-llm-for/agents; owner=$task-agents; scenario=$3-turn web research loop; average loop turns; starting prompt context; final accumulated context; total loop token spend; cost per completed agent task; cost containment ceiling; verified=2026-09-07Unavailable — frozen task-agents fixture requires an exact source, identity, and result receiptUNTESTED — module 2 rule is reproducible but no production observation is claimed
batch59-task-agents-m2-r2
5-turn coding & test execution loop
route=$/best-llm-for/agents; owner=$task-agents; scenario=$5-turn coding & test execution loop; average loop turns; starting prompt context; final accumulated context; total loop token spend; cost per completed agent task; cost containment ceiling; verified=2026-09-07Unavailable — frozen task-agents fixture requires an exact source, identity, and result receiptUNTESTED — module 2 rule is reproducible but no production observation is claimed
batch59-task-agents-m2-r3
10-turn complex data analysis loop
route=$/best-llm-for/agents; owner=$task-agents; scenario=$10-turn complex data analysis loop; average loop turns; starting prompt context; final accumulated context; total loop token spend; cost per completed agent task; cost containment ceiling; verified=2026-09-07Unavailable — frozen task-agents fixture requires an exact source, identity, and result receiptUNTESTED — module 2 rule is reproducible but no production observation is claimed
batch59-task-agents-m2-r4
20-turn deep autonomous task loop
route=$/best-llm-for/agents; owner=$task-agents; scenario=$20-turn deep autonomous task loop; average loop turns; starting prompt context; final accumulated context; total loop token spend; cost per completed agent task; cost containment ceiling; verified=2026-09-07Unavailable — frozen task-agents fixture requires an exact source, identity, and result receiptUNTESTED — module 2 rule is reproducible but no production observation is claimed
batch59-task-agents-m2-r5
infinite loop runaway containment
route=$/best-llm-for/agents; owner=$task-agents; scenario=$infinite loop runaway containment; average loop turns; starting prompt context; final accumulated context; total loop token spend; cost per completed agent task; cost containment ceiling; verified=2026-09-07Unavailable — exact task-agents evidence join is not closed for "infinite loop runaway containment"FAIL CLOSED — manual, probe, or source evidence required
batch59-task-agents-m2-r6
unsupported agent loop depth
route=$/best-llm-for/agents; owner=$task-agents; scenario=$unsupported agent loop depth; average loop turns; starting prompt context; final accumulated context; total loop token spend; cost per completed agent task; cost containment ceiling; verified=2026-09-07Unavailable — exact task-agents evidence join is not closed for "unsupported agent loop depth"FAIL CLOSED — manual, probe, or source evidence required

First-party citation: All AI Ask pricing registry and formulas. Verified 2026-09-07; missing or conflicting joins fail closed.

Agent self-correction and rollback runbook

Deterministic formula / rule: recovery_rate = successful_corrections / error_feedback_prompts; resilience measurement.

Boundary: Owns agentic error recovery evaluation and guardrails.

Frozen scenario / field IDExact identity and evidence fieldsResultState
batch59-task-agents-m3-r1
invalid SQL query execution error
route=$/best-llm-for/agents; owner=$task-agents; scenario=$invalid SQL query execution error; tool failure mode; agent reflection behavior; recovery success probability; maximum retry limit; rollback action; human escalation trigger; verified=2026-09-07Unavailable — frozen task-agents fixture requires an exact source, identity, and result receiptUNTESTED — module 3 rule is reproducible but no production observation is claimed
batch59-task-agents-m3-r2
API endpoint 404 response
route=$/best-llm-for/agents; owner=$task-agents; scenario=$API endpoint 404 response; tool failure mode; agent reflection behavior; recovery success probability; maximum retry limit; rollback action; human escalation trigger; verified=2026-09-07Unavailable — frozen task-agents fixture requires an exact source, identity, and result receiptUNTESTED — module 3 rule is reproducible but no production observation is claimed
batch59-task-agents-m3-r3
schema mismatch on tool output
route=$/best-llm-for/agents; owner=$task-agents; scenario=$schema mismatch on tool output; tool failure mode; agent reflection behavior; recovery success probability; maximum retry limit; rollback action; human escalation trigger; verified=2026-09-07Unavailable — frozen task-agents fixture requires an exact source, identity, and result receiptUNTESTED — module 3 rule is reproducible but no production observation is claimed
batch59-task-agents-m3-r4
file not found filesystem error
route=$/best-llm-for/agents; owner=$task-agents; scenario=$file not found filesystem error; tool failure mode; agent reflection behavior; recovery success probability; maximum retry limit; rollback action; human escalation trigger; verified=2026-09-07Unavailable — frozen task-agents fixture requires an exact source, identity, and result receiptUNTESTED — module 3 rule is reproducible but no production observation is claimed
batch59-task-agents-m3-r5
context window overflow during loop
route=$/best-llm-for/agents; owner=$task-agents; scenario=$context window overflow during loop; tool failure mode; agent reflection behavior; recovery success probability; maximum retry limit; rollback action; human escalation trigger; verified=2026-09-07Unavailable — exact task-agents evidence join is not closed for "context window overflow during loop"FAIL CLOSED — manual, probe, or source evidence required
batch59-task-agents-m3-r6
unhandled tool exception
route=$/best-llm-for/agents; owner=$task-agents; scenario=$unhandled tool exception; tool failure mode; agent reflection behavior; recovery success probability; maximum retry limit; rollback action; human escalation trigger; verified=2026-09-07Unavailable — frozen task-agents fixture requires an exact source, identity, and result receiptUNTESTED — module 3 rule is reproducible but no production observation is claimed

First-party citation: All AI Ask measured speed dataset. Verified 2026-09-07; missing or conflicting joins fail closed.

Method and limitations: this board exposes deterministic rules, first-party citations, and dated evidence identities. It does not invent volume, coverage, entitlement, retention, residency, quota, capacity, feature support, quality, price, reliability, or legal conclusions. Run the task-agents evidence flow →

Which models rank highest for Agents & Tool Use?

"Fit" is a requirements match, not a quality benchmark — it combines price, measured speed, context window, and (where we have run it) graded accuracy on this task. Formula below.

#ModelProviderFitEvidenceTask price/MTokens/secContextScored on
1Muse Spark 1.3 ContributorMeta91$0.121.0Mprice, context
2GLM-5.2Z.ai84100/1$2.001Mprice, context, evidence
3GPT-OSS 120B (Cerebras)Cerebras77$0.432450131Kprice, context, speed
4Gemini 3.7 FlashGoogle64$1.351.0Mprice, context
5GLM 4.7 (Cerebras)Cerebras61$2.351980200Kprice, context, speed
6Muse Spark 1.3Meta60$1.851.0Mprice, context
7Gemini 3.1 ProGoogle5599/1$4.00552Mprice, context, speed, evidence
8GPT-OSS 20BGroq51$0.121120131Kprice, context, speed

What will Agents & Tool Use cost?

At 30,000 multi-step agent task calls/month:

ModelTask price/MEst. monthly cost
Muse Spark 1.3 Contributor$0.12$27.00
GLM-5.2$2.00$450.00
GPT-OSS 120B (Cerebras)$0.43$96.75

How is the best LLM for Agents & Tool Use ranked?

Weights: evidence 40%, price 15%, speed 35%, context 10%.

Requirements: reasoning mode. 28 models eligible.

Price and context sub-scores are min-max normalised (log-scaled) within this task's eligible set only. Speed uses measured tokens/sec only — estimated rows are excluded. A model missing a measurement is never scored as zero: its weight is redistributed across the components we do have, and "Scored on" in the table above shows exactly which ones.

Prices verified 2026-08-08, accuracy graded 2026-06-21.

What related resources help with Agents & Tool Use?

Meta provider hubMuse Spark 1.3 Contributor pricingBest LLM for CodingBest LLM for Math & ReasoningBest LLM for Chatbots & Support

What are common questions about the best LLM for Agents & Tool Use?

Why is speed weighted so heavily for agents?

An agent loop is many sequential model calls, not one — a model that is 2x faster finishes a 10-step loop in roughly half the wall-clock time.

Do I need a reasoning model for tool-use agents?

For anything beyond simple single-tool calls, yes — planning which tool to call next and interpreting its output benefits directly from an explicit reasoning mode.

Is our agents evidence the same as a full agent benchmark?

No — it is one algorithmic coding task graded for correctness, used as a proxy for step-level reasoning quality. Treat it as a signal, not a full agentic-benchmark score.

Run this exact prompt against the top 3

Don't take a ranking's word for it — try Muse Spark 1.3 Contributor and its closest alternatives on your own prompt.

Try It Free