Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,35 @@ All notable changes to blockrun-llm will be documented in this file.

## Unreleased

## 1.24.1 — 2026-11-27

### Changed
- **`router_core` re-synced to upstream `@blockrun/router-core` `92f77ec`**
(was `53fe783`), a funded re-probe of the models that had no tool-call
evidence. No routing decision moves: all 88 cross-language snapshot
decisions are unchanged and still match the TypeScript engine.
- Mistral Large 4, Qwen 3.8 Max, Qwen 3.8 Flash, Hunyuan 4 Preview and the
newly listed GPT-6.1 Terra returned a well-formed tool call, so the
capability snapshot marks them tool-capable. None of them is in a chain
or the tool-call rescue list; they serve a tool-required turn only when a
caller pins them or a host's evidence pool reaches them.
- `poolside/laguna-s-2.1` answered 500 after payment on both probe runs, so
it stays out of tool-required routes. Plain chat to it is unchanged.
- The capability snapshot is synced to the 2026-11-28 catalog (93 text
models), and model performance profiles are refreshed from upstream
(five new profiles).
- `scripts/port_router_core_capabilities.py` regenerates
`model_capabilities.py` from a router-core checkout (`--router-core
<path> --ref <sha>`) or a copy of `model-capabilities.ts`; `--check`
verifies the committed file. Run on `92f77ec` it reproduces the committed
file byte for byte, and on `53fe783` it reproduces the 1.24.0 port.

### Docs
- README model list matches the 2026-11-28 catalogs: adds GPT-6.2 Astra,
GPT-6.1 Terra, Gemini 4 Neon and Hydrogen, and a "Listed on Solana only"
table (Meta Muse Wonder 1.0 and Spark 1.3, Reflection Beam 1.0); marks
Laguna S 2.1 as not for tool calls.

## 1.24.0 — 2026-11-27

### Changed
Expand Down
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -530,13 +530,17 @@ and `client.list_image_models()` return exactly what the gateway is charging.

The GPT-6 generation: Astra is the flagship for long-horizon agentic work and
computer use, Sol the cost-efficient tier for complex coding (`gpt-6.2-sol` is the
newest Sol, `gpt-6.1-sol` the one before it), Luna the fast low-cost tier.
newest Sol, `gpt-6.1-sol` the one before it), Terra (`gpt-6.1-terra`) the cheaper
tier for coding, computer use and agents at scale, Luna the fast low-cost tier.
`gpt-6.2-astra` is the newest Astra.

| Model | Context |
|---|---|
| `openai/gpt-6.2-astra` | 1.05M |
| `openai/gpt-6-astra` | 1.05M |
| `openai/gpt-6.2-sol` | 1.05M |
| `openai/gpt-6.1-sol` | 1.05M |
| `openai/gpt-6.1-terra` | 1.05M |
| `openai/gpt-6-sol` | 1.05M |
| `openai/gpt-6-luna` | 1.05M |

Expand Down Expand Up @@ -611,8 +615,10 @@ longer at the same token price.

| Model | Context | Notes |
|---|---|---|
| `google/gemini-4-neon` | 1M | Newest Gemini 4 — agentic coding and knowledge work |
| `google/gemini-4-carbon` | 1M | |
| `google/gemini-4-argon` | 1M | |
| `google/gemini-4-hydrogen` | 1M | Fast, efficient Gemini 4 for everyday coding and agents |
| `google/gemini-3.1-pro` | 1M | |
| `google/gemini-3.8-flash` | 1M | |
| `google/gemini-3.6-flash` | 1M | |
Expand Down Expand Up @@ -687,7 +693,19 @@ only ranks what `/v1/models` lists.
|---|---|---|
| `mistral/mistral-large-4` | 512K | Mistral flagship — reasoning, coding, image input |
| `tencent/hy4-preview` | 1M | Hy4 — 770B open-weight MoE (Apache 2.0) |
| `poolside/laguna-s-2.1` | 1M | 118B open-weight coding model |
| `poolside/laguna-s-2.1` | 1M | 118B open-weight coding model. Not for tool calls: the 2026-11-28 tool probe got a 500 after payment, so smart routing never sends it a tool-calling turn. Plain chat works |

### Listed on Solana only

These are in the Solana catalog
([sol.blockrun.ai](https://sol.blockrun.ai/api/v1/models)) but not the Base
one; call them with `chain="solana"`.

| Model | Context | Notes |
|---|---|---|
| `meta/muse-wonder-1.0` | 1M | Meta's frontier model (preview), image + text input, always reasons |
| `meta/muse-spark-1.3` | 1M | Meta's current general model, image + text input, always reasons |
| `reflection/beam-1.0-501b-a23b` | 1M | Open-weight 501B MoE reasoning model for coding and long-horizon agents |

### Free Tier

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.24.0
1.24.1
2 changes: 1 addition & 1 deletion blockrun_llm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
create_wallet as generate_wallet, # User-friendly alias
)

__version__ = "1.24.0"
__version__ = "1.24.1"
__all__ = [
"DECISIONS_DEFAULT_MODEL",
"DEFAULT_API_KEY_URL",
Expand Down
2 changes: 1 addition & 1 deletion blockrun_llm/router_core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Router Core — deterministic, constraint-first model routing.

Python port of `@blockrun/router-core <https://github.com/BlockRunAI/router-core>`_
(upstream commit ``53fe783``), the same routing engine the TypeScript SDK and
(upstream commit ``92f77ec``), the same routing engine the TypeScript SDK and
the BlockRun gateway use. The package is deliberately product-neutral: task
classification, hard capability filtering, portfolio scoring, ordered
fallbacks, and routing configuration. It contains no wallet, gateway client,
Expand Down
2 changes: 1 addition & 1 deletion blockrun_llm/router_core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Default Routing Config

Python port of ``@blockrun/router-core`` ``config.ts`` (upstream commit
``53fe783``, 2026-11-27, so it is the same table the TypeScript SDK bundles).
``92f77ec``, 2026-11-27, so it is the same table the TypeScript SDK bundles).
V3.5: every tier rung is a public catalog id.

All routing parameters as a module constant. Hosts override by passing their
Expand Down
21 changes: 12 additions & 9 deletions blockrun_llm/router_core/model_capabilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
product catalog is temporarily unavailable, without importing product code.

GENERATED upstream by ``scripts/sync-model-capabilities.mjs`` from the public
catalog (GET https://blockrun.ai/api/v1/models) on 2026-11-27; ``supports_tools``
catalog (GET https://blockrun.ai/api/v1/models) on 2026-11-28; ``supports_tools``
comes from a live function-calling probe. Re-sync from ``model-capabilities.ts``
rather than editing by hand — a hand edit is lost on the next sync.
"""
Expand Down Expand Up @@ -246,11 +246,10 @@
"supports_tools": True,
"supports_vision": False,
},
# supportsTools: not probed — fails closed
"mistral/mistral-large-4": {
"context_window": 524_288,
"max_output_tokens": 262_144,
"supports_tools": False,
"supports_tools": True,
"supports_vision": True,
},
"moonshot/kimi-k3.1-pro": {
Expand Down Expand Up @@ -477,6 +476,12 @@
"supports_tools": True,
"supports_vision": True,
},
"openai/gpt-6.1-terra": {
"context_window": 1_050_000,
"max_output_tokens": 128_000,
"supports_tools": True,
"supports_vision": True,
},
"openai/gpt-6.2-astra": {
"context_window": 1_050_000,
"max_output_tokens": 128_000,
Expand All @@ -495,7 +500,7 @@
"supports_tools": True,
"supports_vision": False,
},
# supportsTools: not probed — fails closed
# supportsTools: gateway unavailable at probe time — fails closed
"poolside/laguna-s-2.1": {
"context_window": 1_048_576,
"max_output_tokens": 131_072,
Expand Down Expand Up @@ -529,21 +534,19 @@
"qwen/qwen3.8-flash": {
"context_window": 1_000_000,
"max_output_tokens": 131_072,
"supports_tools": False,
"supports_tools": True,
"supports_vision": True,
},
# supportsTools: not probed — fails closed
"qwen/qwen3.8-max": {
"context_window": 1_000_000,
"max_output_tokens": 131_072,
"supports_tools": False,
"supports_tools": True,
"supports_vision": False,
},
# supportsTools: not probed — fails closed
"tencent/hy4-preview": {
"context_window": 1_048_576,
"max_output_tokens": 64_000,
"supports_tools": False,
"supports_tools": True,
"supports_vision": False,
},
"xai/grok-4.3": {
Expand Down
40 changes: 40 additions & 0 deletions blockrun_llm/router_core/model_profiles.generated.json
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,14 @@
"errorRate": 0,
"samples": 3
},
"mistral/mistral-large-4": {
"measuredAt": "2026-11-28T04:13:09Z",
"latencyMs": 6174.9,
"p95LatencyMs": 7306.8,
"outputTokensPerSecond": 84.27,
"errorRate": 0,
"samples": 3
},
"moonshot/kimi-k3": {
"measuredAt": "2026-08-29T16:51:33Z",
"latencyMs": 24498.9,
Expand Down Expand Up @@ -479,6 +487,14 @@
"errorRate": 0,
"samples": 3
},
"openai/gpt-6.1-terra": {
"measuredAt": "2026-11-28T04:14:35Z",
"latencyMs": 6020,
"p95LatencyMs": 6378.1,
"outputTokensPerSecond": 57.78,
"errorRate": 0,
"samples": 3
},
"openai/gpt-6.2-astra": {
"measuredAt": "2026-11-27T23:25:03Z",
"latencyMs": 7973.9,
Expand Down Expand Up @@ -551,6 +567,22 @@
"errorRate": 0,
"samples": 3
},
"qwen/qwen3.8-flash": {
"measuredAt": "2026-11-28T04:13:09Z",
"latencyMs": 8271.9,
"p95LatencyMs": 8495,
"outputTokensPerSecond": 61.95,
"errorRate": 0,
"samples": 3
},
"qwen/qwen3.8-max": {
"measuredAt": "2026-11-28T04:13:09Z",
"latencyMs": 15575.9,
"p95LatencyMs": 16331,
"outputTokensPerSecond": 32.95,
"errorRate": 0,
"samples": 3
},
"tencent/hy3": {
"measuredAt": "2026-08-29T16:51:33Z",
"latencyMs": 6062.3,
Expand All @@ -559,6 +591,14 @@
"errorRate": 0,
"samples": 3
},
"tencent/hy4-preview": {
"measuredAt": "2026-11-28T04:13:09Z",
"latencyMs": 9049.2,
"p95LatencyMs": 9460.4,
"outputTokensPerSecond": 56.69,
"errorRate": 0,
"samples": 3
},
"xai/grok-4.3": {
"measuredAt": "2026-08-29T16:51:33Z",
"latencyMs": 9467.7,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "blockrun-llm"
version = "1.24.0"
version = "1.24.1"
description = "BlockRun SDK - Pay-per-request AI (LLM, Image, Video, Music, Voice) via x402 on Base and Solana"
readme = "README.md"
license = "MIT"
Expand Down
128 changes: 128 additions & 0 deletions scripts/port_router_core_capabilities.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
"""Regenerate ``blockrun_llm/router_core/model_capabilities.py`` from upstream.

Upstream ``@blockrun/router-core`` generates ``src/model-capabilities.ts`` from
the public catalog plus a live function-calling probe. This script translates
that file to the Python port: same entries, same order, same override comments
(wrapped at 92 columns), with the catalog date in the module docstring updated.
The rest of the module header is kept from the current Python file.

Usage, from the repository root, against a router-core checkout at a commit:

python scripts/port_router_core_capabilities.py \\
--router-core ../router-core --ref 92f77ec

or against a copy of the TypeScript file:

python scripts/port_router_core_capabilities.py --ts-file model-capabilities.ts

``--check`` writes nothing and exits 1 if the committed file differs from what
the source would generate. Rerunning it on the commit named in
``blockrun_llm/router_core/__init__.py`` must reproduce the committed file byte
for byte.

A re-sync also needs ``src/model-profiles.generated.json`` copied to
``blockrun_llm/router_core/model_profiles.generated.json``, the upstream commit
markers updated, and upstream test changes mirrored by hand.
"""

from __future__ import annotations

import argparse
import re
import subprocess
import sys
import textwrap
from pathlib import Path

REPO_ROOT = Path(__file__).resolve().parent.parent
TARGET = REPO_ROOT / "blockrun_llm" / "router_core" / "model_capabilities.py"
TS_PATH = "src/model-capabilities.ts"
COMMENT_WIDTH = 92

_ENTRY = re.compile(
r'^ "([^"]+)": \{(?: // (.*))?\n'
r" contextWindow: ([\d_]+),\n"
r" maxOutputTokens: ([\d_]+),\n"
r" supportsTools: (true|false),\n"
r" supportsVision: (true|false),\n"
r" \},$",
re.MULTILINE,
)
_KEY = re.compile(r'^ "([^"]+)": \{', re.MULTILINE)
_DATE = re.compile(r"(api/v1/models\) on )(\d{4}-\d{2}-\d{2})")


def port(ts: str, current_py: str) -> str:
"""Return the Python module for ``ts``, keeping ``current_py``'s header."""
date_match = _DATE.search(ts)
if date_match is None:
raise ValueError("no catalog date found in the TypeScript header")
head, sep, _ = current_py.partition("DEFAULT_MODEL_CAPABILITIES: Mapping")
if not sep:
raise ValueError("DEFAULT_MODEL_CAPABILITIES not found in the current Python file")
head = _DATE.sub(lambda m: m.group(1) + date_match.group(2), head)

body = ts[ts.index("Object.freeze({") :]
entries = _ENTRY.findall(body)
if [e[0] for e in entries] != _KEY.findall(body):
raise ValueError("an entry in the TypeScript file does not have the expected shape")

out = [
head,
"DEFAULT_MODEL_CAPABILITIES: Mapping[str, ModelCapabilities] = MappingProxyType(\n",
" {\n",
]
for key, comment, context, max_output, tools, vision in entries:
if comment:
lines = textwrap.wrap(comment, width=COMMENT_WIDTH)
out.append("\n".join(" # " + line for line in lines) + "\n")
out.append(
f' "{key}": {{\n'
f' "context_window": {context},\n'
f' "max_output_tokens": {max_output},\n'
f' "supports_tools": {tools.capitalize()},\n'
f' "supports_vision": {vision.capitalize()},\n'
" },\n"
)
out.append(" }\n)\n")
return "".join(out)


def main(argv: list[str] | None = None) -> int:
parser = argparse.ArgumentParser(description=__doc__.splitlines()[0])
source = parser.add_mutually_exclusive_group(required=True)
source.add_argument("--router-core", type=Path, help="path to a router-core git checkout")
source.add_argument("--ts-file", type=Path, help="path to a model-capabilities.ts file")
parser.add_argument("--ref", default="HEAD", help="router-core commit (default: HEAD)")
parser.add_argument("--check", action="store_true", help="compare only; write nothing")
args = parser.parse_args(argv)

if args.ts_file is not None:
ts = args.ts_file.read_text(encoding="utf-8")
else:
ts = subprocess.run(
["git", "-C", str(args.router_core), "show", f"{args.ref}:{TS_PATH}"],
check=True,
capture_output=True,
text=True,
encoding="utf-8",
).stdout

current = TARGET.read_text(encoding="utf-8")
generated = port(ts, current)
count = generated.count('"context_window"')

if args.check:
if generated != current:
print(f"{TARGET.relative_to(REPO_ROOT)} is out of date ({count} entries)")
return 1
print(f"{TARGET.relative_to(REPO_ROOT)} is up to date ({count} entries)")
return 0

TARGET.write_text(generated, encoding="utf-8")
print(f"wrote {TARGET.relative_to(REPO_ROOT)} ({count} entries)")
return 0


if __name__ == "__main__":
sys.exit(main())
Loading
Loading