Skip to content
Draft
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
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ Model name prefixes determine routing:
- **Google**: gemini-3.8-flash, gemini-3.7-flash, gemini-3.6-flash, gemini-3.5-flash-lite, gemini-2.5-flash, gemini-2.5-flash-lite, gemini-2.5-pro, gemini-3-pro-preview, gemini-3-flash-preview, gemini-3.1-pro-preview, gemini-3.5-flash; image generation: gemini-2.5-flash-image, gemini-3.1-flash-image
- **xAI**: grok-2, grok-3, grok-3-mini, grok-4, grok-4.3, grok-4.5, grok-4.6, grok-4-fast, grok-4-1-fast; image generation: grok-2-image, grok-imagine-image-2.0
- **ByteDance** (BytePlus ModelArk, OpenAI-compatible, ap-southeast): seed-1.6, seed-1.8, seed-2.0-lite, deepseek-v4-flash, deepseek-v4-pro, glm-5.2 (Z.ai's model served via a ModelArk deployment endpoint); image generation: seedream-4.0, seedream-5.0-lite, seedance-4.5, seedance-5.0
- **OpenRouter** (OpenAI-compatible): hermes-4-405b, hermes-4-70b, hy3
- **OpenRouter** (OpenAI-compatible): hy4-preview, hermes-4-405b, hermes-4-70b, hy3
- **Z.ai** (Model API, OpenAI-compatible): image generation: glm-image (glm-5.2 chat is routed through BytePlus ModelArk, see ByteDance above)

Image generation via OpenAI (gpt-image-2), xAI (grok-2-image, grok-imagine-image-2.0), ByteDance
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ The gateway solves this by running inside a hardware-isolated Nitro Enclave wher
| Google | gemini-3.8-flash, gemini-3.7-flash, gemini-3.6-flash, gemini-3.5-flash-lite, gemini-2.5-flash, gemini-2.5-flash-lite, gemini-2.5-pro, gemini-3-pro-preview, gemini-3-flash-preview |
| xAI | grok-4.6, grok-4.5, grok-4.3, grok-4, grok-4-fast, grok-4-1-fast, grok-4-1-fast-non-reasoning |
| ByteDance | seed-1.6, seed-1.8, seed-2.0-lite, deepseek-v4-flash, deepseek-v4-pro |
| OpenRouter | hermes-4-405b, hermes-4-70b, hy3 |
| OpenRouter | hy4-preview, hermes-4-405b, hermes-4-70b, hy3 |

## Quick Start

Expand Down
16 changes: 16 additions & 0 deletions tee_gateway/model_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,19 @@ class SupportedModel(Enum):
)

# ── OpenRouter (OpenAI-compatible) ──────────────────────────────────
# Tencent Hy4 Preview — 770B-parameter (49B active) open-weight MoE,
# open-sourced 2026-08-28, aimed at coding agents and long-horizon
# tool-use with a 1,048,576-token context window. Routed through
# OpenRouter like hy3, using OpenRouter's list pricing. Tencent
# recommends temperature=0.9 for inference; the model accepts the
# standard sampling params (OpenRouter model page), so no
# supports_temperature/force_temperature override is needed.
HY4_PREVIEW = ModelConfig(
provider="openrouter",
api_name="tencent/hy4-preview",
input_price_usd=Decimal("0.000000834"),
output_price_usd=Decimal("0.000002501"),
)
# Nous no longer serves Hermes 4 through Nous Portal, so both models route
# through their canonical OpenRouter slugs and use OpenRouter list pricing.
HERMES_4_405B = ModelConfig(
Expand Down Expand Up @@ -796,6 +809,9 @@ class SupportedModel(Enum):
"hy3": SupportedModel.HY3,
"tencent/hy3": SupportedModel.HY3,
"tencent/hy3:floor": SupportedModel.HY3,
"hy4-preview": SupportedModel.HY4_PREVIEW,
"hy4": SupportedModel.HY4_PREVIEW,
"tencent/hy4-preview": SupportedModel.HY4_PREVIEW,
# Z.ai
"glm-5.2": SupportedModel.GLM_5_2,
"ep-20260803211658-fwpzs": SupportedModel.GLM_5_2,
Expand Down
15 changes: 15 additions & 0 deletions tests/test_pricing.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,15 @@ def test_hy3_resolves(self):
self.assertEqual(cfg, get_model_config("tencent/hy3"))
self.assertEqual(cfg, get_model_config("tencent/hy3:floor"))

def test_hy4_preview_resolves(self):
cfg = get_model_config("hy4-preview")
self.assertEqual(cfg.provider, "openrouter")
self.assertEqual(cfg.api_name, "tencent/hy4-preview")
self.assertEqual(cfg.input_price_usd, Decimal("0.000000834"))
self.assertEqual(cfg.output_price_usd, Decimal("0.000002501"))
self.assertEqual(cfg, get_model_config("hy4"))
self.assertEqual(cfg, get_model_config("tencent/hy4-preview"))

# ── Z.ai (Model API) ───────────────────────────────────────────────────

def test_glm_5_2_resolves(self):
Expand Down Expand Up @@ -927,6 +936,12 @@ def test_hy3_cost(self):
247_500_000_000_000,
)

def test_hy4_preview_cost(self):
self.assertEqual(
self._calc("hy4-preview", 1000, 500),
2_084_500_000_000_000,
)

# ── Haiku is cheaper than Sonnet ────────────────────────────────────────

def test_haiku_cheaper_than_sonnet(self):
Expand Down
Loading