From 6a51ad9c66dba130981bce4e1f1df9ec162072fc Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 20 Nov 2026 07:11:37 +0000 Subject: [PATCH] Add Tencent Hy4 Flash to the model registry Hy4 Flash (released 2026-11-16) is Tencent's ~220B-parameter (12B active) open-weight MoE with text + image input and a 1M-token context. Routed through OpenRouter like hy3, at OpenRouter's list rate ($0.035 / $0.1405 per MTok). chat-api offers it in place of Hy3 on the affordable tier. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SQvDLyFCCRZxHeRQ9GM1T5 --- CLAUDE.md | 2 +- README.md | 2 +- tee_gateway/model_registry.py | 16 ++++++++++++++++ tests/test_pricing.py | 16 ++++++++++++++++ 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 02cf409..5256c0f 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -135,7 +135,7 @@ prefixes determine routing: - **Google**: gemini-4-neon, gemini-4-hydrogen, gemini-4-carbon, gemini-4-argon, gemini-3.8-flash, gemini-3.7-flash, gemini-3.6-flash, gemini-3.5-flash, gemini-3.5-flash-lite, gemini-2.5-flash, gemini-2.5-flash-lite, gemini-2.5-pro, gemini-3-flash-preview, gemini-3.1-pro-preview; image generation: gemini-2.5-flash-image, gemini-3.1-flash-image, gemini-nano-banana-2.1 - **xAI**: grok-4.7, grok-4.6, grok-4.5, grok-4.3, grok-4.20-reasoning, grok-4.20-non-reasoning; 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, 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): aion-3.5, deepseek-v4-pro (pinned to Together), hy4-preview, hermes-4-405b, hy3 +- **OpenRouter** (OpenAI-compatible): hy4-flash, aion-3.5, deepseek-v4-pro (pinned to Together), hy4-preview, hermes-4-405b, hy3 - **abliteration.ai** (OpenAI-compatible): abliterated-model-large-v2 - **Moonshot AI** (Kimi API, OpenAI-compatible, api.moonshot.ai): kimi-k3.1-pro - **NEAR AI** (NEAR AI Cloud, OpenAI-compatible, cloud-api.near.ai): deepseek-v4.1-flash-abliterated diff --git a/README.md b/README.md index 1e75dbe..a7225f9 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ The gateway solves this by running inside a hardware-isolated Nitro Enclave wher | Google | gemini-4-neon, gemini-4-hydrogen, gemini-4-carbon, gemini-4-argon, gemini-3.8-flash, gemini-3.7-flash, gemini-3.6-flash, gemini-3.5-flash, gemini-3.5-flash-lite, gemini-2.5-flash, gemini-2.5-flash-lite, gemini-2.5-pro, gemini-3-flash-preview, gemini-3.1-pro-preview | | xAI | grok-4.7, grok-4.6, grok-4.5, grok-4.3, grok-4.20-reasoning, grok-4.20-non-reasoning | | ByteDance | seed-1.6, seed-1.8, seed-2.0-lite, dola-seed-2.0-mini, deepseek-v4-flash, glm-5.2 | -| OpenRouter | aion-3.5, deepseek-v4-pro, hy4-preview, hermes-4-405b, hy3 | +| OpenRouter | hy4-flash, aion-3.5, deepseek-v4-pro, hy4-preview, hermes-4-405b, hy3 | | abliteration.ai | abliterated-model-large-v2 | | Moonshot AI | kimi-k3.1-pro | | NEAR AI | deepseek-v4.1-flash-abliterated | diff --git a/tee_gateway/model_registry.py b/tee_gateway/model_registry.py index 679e046..cba067c 100644 --- a/tee_gateway/model_registry.py +++ b/tee_gateway/model_registry.py @@ -1237,6 +1237,20 @@ class SupportedModel(Enum): output_price_usd=Decimal("0.00000396"), openrouter_provider="together", ) + # Tencent Hy4 Flash — released 2026-11-16: ~220B-parameter (12B active) + # open-weight MoE, text + image input, 1,048,576-token context. Tencent + # positions it for everyday/high-volume work at a fraction of Hy4's cost. + # Routed through OpenRouter like hy3 (Tencent Cloud is its only provider + # there); rate from openrouter.ai/api/v1/models. OpenRouter lists + # `temperature` and `reasoning` among its supported parameters, and the + # model card documents reasoning_effort (incl. no-think) for toggling + # thinking, so no supports_temperature/force_temperature override. + HY4_FLASH = ModelConfig( + provider="openrouter", + api_name="tencent/hy4-flash", + input_price_usd=Decimal("0.000000035"), + output_price_usd=Decimal("0.0000001405"), + ) # 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 @@ -1636,6 +1650,8 @@ class SupportedModel(Enum): "hy3": SupportedModel.HY3, "tencent/hy3": SupportedModel.HY3, "tencent/hy3:floor": SupportedModel.HY3, + "hy4-flash": SupportedModel.HY4_FLASH, + "tencent/hy4-flash": SupportedModel.HY4_FLASH, "hy4-preview": SupportedModel.HY4_PREVIEW, "hy4": SupportedModel.HY4_PREVIEW, "tencent/hy4-preview": SupportedModel.HY4_PREVIEW, diff --git a/tests/test_pricing.py b/tests/test_pricing.py index 2e3b40e..c8735ce 100644 --- a/tests/test_pricing.py +++ b/tests/test_pricing.py @@ -760,6 +760,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_flash_resolves(self): + cfg = get_model_config("hy4-flash") + self.assertEqual(cfg.provider, "openrouter") + self.assertEqual(cfg.api_name, "tencent/hy4-flash") + self.assertEqual(cfg.input_price_usd, Decimal("0.000000035")) + self.assertEqual(cfg.output_price_usd, Decimal("0.0000001405")) + self.assertTrue(cfg.supports_temperature) + self.assertEqual(cfg, get_model_config("tencent/hy4-flash")) + def test_kimi_k3_1_pro_resolves(self): cfg = get_model_config("kimi-k3.1-pro") self.assertEqual(cfg.provider, "moonshot") @@ -1405,6 +1414,13 @@ def test_hy3_cost(self): 396_000_000_000_000, ) + def test_hy4_flash_cost(self): + # 1000*0.000000035 + 500*0.0000001405 = 0.000035 + 0.00007025 = 0.00010525 USD + self.assertEqual( + self._calc("hy4-flash", 1000, 500), + 105_250_000_000_000, + ) + def test_abliterated_large_v2_cost(self): # 1000*0.000003 + 500*0.000005 = 0.003 + 0.0025 = 0.0055 USD self.assertEqual(