ModelstencentHy4 flash
providertencent /

Hy4 flash

25 DZD in 99 DZD out 1.05 DZD cached/ 1M tokens

Tencent's most cost-effective Hy4 model: a 220B Mixture-of-Experts with only 12B active per token, reading text, images and PDFs across a 1M-token context. Reasoning is on by default and can be switched off for fast, cheap answers — built for everyday productivity, extraction and agent steps at volume.

Public1048576JSONPDF
Hy4 flash
Capabilities
  • Tools
  • Vision
  • PDF input
  • Reasoning
  • Structured output
Reasoning
Always onreasoning_effort
  • none
  • low
  • medium
  • high
  • xhigh
Tool choice
  • required
ArchitectureMixture-of-Experts
Context Window1,048,576 tokensShared by input and output · up to 1,048,576 output tokens

Use Hy4 flash in VS Code, Cursor and Antigravity

DEVUP Code, the DEVUP AI extension, is free to install. Requests are paid from your DEVUP balance.

Explore DEVUP Code

Hy4 flash

Hy4 flash

Hy4 flash is the low-cost member of Tencent's Hy4 generation. It takes text and a single image, writes text, and works across a context of just over a million tokens — while activating only about 12B of its 220B parameters for each token.

Tencent positions it for everyday productivity work: deep search, document processing, slide creation, simple frontend demos and computer use. On Tencent's internal productivity benchmark it lands slightly above Hy4 preview, and Tencent reports a cost per task many times lower than either Hy4 preview or Hy4.

It reasons before answering by default, and — unlike its larger sibling — that reasoning can be switched off cleanly.

Weights are open under the Tencent Hy License 1.0.


At a glance

Model typeMixture-of-Experts, text and image understanding
Total parameters220B, of which 63.5B are Engram n-gram tables
Active per token11.3B text + 0.43B vision
Layers42 — one dense, 41 MoE
Experts512 routed (LatentMoE) + 1 shared, 16 active per token
AttentionSparse attention and sliding-window attention, interleaved 1:3
Vision encoderAdapted from SigLIP2-So400m, 0.43B
InputText, one image per request, PDF
OutputText
Maximum context size1,048,576 tokens
Maximum output1,048,576 tokens
ReasoningOn by default, can be disabled
LicenseTencent Hy License 1.0

Input and output are counted against the same 1,048,576-token window, so a long prompt leaves less room for the reply.


Getting started

BASH
curl https://api.devupai.com/v1/chat/completions \
  -H "Authorization: Bearer $DEVUP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "tencent/Hy4-flash",
    "messages": [
      { "role": "user", "content": "Turn these meeting notes into a list of decisions, owners and deadlines." }
    ]
  }'

Python, using the OpenAI client:

PYTHON
from openai import OpenAI
import os

client = OpenAI(
    api_key=os.environ["DEVUP_API_KEY"],
    base_url="https://api.devupai.com/v1",
)

response = client.chat.completions.create(
    model="tencent/Hy4-flash",
    messages=[
        {"role": "user", "content": "Turn these meeting notes into a list of decisions, owners and deadlines."}
    ],
    temperature=0.9,
    top_p=1.0,
)

print(response.choices[0].message.content)

Node.js:

JAVASCRIPT
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.DEVUP_API_KEY,
  baseURL: "https://api.devupai.com/v1",
});

const response = await client.chat.completions.create({
  model: "tencent/Hy4-flash",
  messages: [
    { role: "user", content: "Turn these meeting notes into a list of decisions, owners and deadlines." },
  ],
  temperature: 0.9,
  top_p: 1.0,
});

console.log(response.choices[0].message.content);

The sampling values above — temperature: 0.9, top_p: 1.0 — are the ones Tencent recommends.


Reasoning

Without any parameter, Hy4 flash thinks first and answers second. The thinking comes back in a field of its own, apart from content, and its length is reported in usage.completion_tokens_details.reasoning_tokens. Those tokens are billed as output.

Switching it off

Send reasoning_effort: "none" for a direct answer:

PYTHON
response = client.chat.completions.create(
    model="tencent/Hy4-flash",
    reasoning_effort="none",
    messages=[{"role": "user", "content": "What is 2+2? Answer with the number only."}],
)
# content: "4"   reasoning_tokens: 0

We verified this returns a clean content with no reasoning in it. For lookups, rewrites, classification and short extraction, none is the cheapest and fastest way to run this model.

The Hugging Face model card also mentions no_think. This endpoint does not accept it — it is refused with HTTP 422. Use none.

Effort levels

low, medium, high and xhigh are accepted, and all of them keep reasoning on. They are not a graded scale. Run three times each on the same counting problem:

LevelReasoning tokens per run
low303 · 259 · 370
high316 · 686 · 158
xhigh505 · 361 · 400

The spread inside a single level is wider than the gap between levels, and every run answered correctly. In practice there are two settings: reasoning on (leave the parameter out) and reasoning off (none).

Leave room for the thinking

With reasoning on, the thinking and the answer share max_tokens. If the cap is too low the reply can end before the answer starts. Allow a few thousand tokens for anything non-trivial, and treat finish_reason: "length" as a sign to raise it.


Images

Send an image as an image_url content part — a hosted link or a base64 data URI.

PYTHON
import base64

with open("screenshot.png", "rb") as f:
    img = base64.b64encode(f.read()).decode()

response = client.chat.completions.create(
    model="tencent/Hy4-flash",
    max_tokens=1500,
    messages=[{
        "role": "user",
        "content": [
            {"type": "text", "text": "Which button on this screen submits the form?"},
            {"type": "image_url", "image_url": {"url": f"data:image/png;base64,{img}"}},
        ],
    }],
)

Tencent's usage notes allow one image per request. Several screenshots mean several requests.


PDF documents

PDFs go in as file content parts:

PYTHON
import base64

with open("invoice.pdf", "rb") as f:
    pdf = base64.b64encode(f.read()).decode()

response = client.chat.completions.create(
    model="tencent/Hy4-flash",
    reasoning_effort="none",
    max_tokens=1500,
    messages=[{
        "role": "user",
        "content": [
            {"type": "text", "text": "Give the invoice number, the issue date and the total due."},
            {"type": "file", "file": {
                "filename": "invoice.pdf",
                "file_data": f"data:application/pdf;base64,{pdf}",
            }},
        ],
    }],
)

Straight extraction like this rarely needs reasoning, which is why the example turns it off.


Tool calling

Tools use the standard tools format. The model can choose freely, can be required to call some tool with tool_choice: "required", or can be pointed at one function by name.

PYTHON
tools = [{
    "type": "function",
    "function": {
        "name": "search_orders",
        "description": "Find a customer's orders by email",
        "parameters": {
            "type": "object",
            "properties": {"email": {"type": "string"}},
            "required": ["email"],
        },
    },
}]

response = client.chat.completions.create(
    model="tencent/Hy4-flash",
    max_tokens=3000,
    messages=[{"role": "user", "content": "What did sara@example.com order last week?"}],
    tools=tools,
    tool_choice={"type": "function", "function": {"name": "search_orders"}},
)

call = response.choices[0].message.tool_calls[0]
print(call.function.name, call.function.arguments)

The reply ends with finish_reason: "tool_calls". On agent turns, give max_tokens enough headroom for the reasoning that precedes the call — a cap that is too tight can cut the turn off before the call is emitted.


Structured output

json_schema and json_object are both honoured.

BASH
curl https://api.devupai.com/v1/chat/completions \
  -H "Authorization: Bearer $DEVUP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "tencent/Hy4-flash",
    "reasoning_effort": "none",
    "messages": [
      { "role": "user", "content": "Classify this ticket and rate its urgency from 1 to 5: \"Payment page shows error 500 for all users since 09:00.\"" }
    ],
    "response_format": {
      "type": "json_schema",
      "json_schema": {
        "name": "ticket",
        "strict": true,
        "schema": {
          "type": "object",
          "properties": {
            "category": { "type": "string" },
            "urgency": { "type": "integer" }
          },
          "required": ["category", "urgency"],
          "additionalProperties": false
        }
      }
    }
  }'

High-volume labelling and extraction are where this model fits best. Pair json_schema with reasoning_effort: "none" and the output is short, fast and machine-readable.


Prompt caching

Repeated input is billed at a much lower cached rate. Keep the parts that do not change — system prompt, tool definitions, reference material — at the very beginning, and append the parts that do. A value that changes on every call, placed early, defeats the cache for everything after it.


Architecture

Hy4 flash keeps Hy4's overall design and changes three things to cut memory and compute.

Hybrid attention. Sparse attention layers that select up to 2,048 relevant positions are interleaved with sliding-window layers that look only at the last 512 tokens, one to three. Most layers therefore never touch the full context. Tencent reports a KV cache one-sixth the size of Hy4's and one twenty-fourth of Hy3's.

LatentMoE. Each of the 41 MoE layers holds 512 routed experts that operate in a compressed latent space; a token uses 16 of them plus one shared expert.

Engram. A 63.5B-parameter table of learned bigram and trigram representations, looked up by hashing at four points in the network. It adds knowledge capacity without adding compute per token, which is why the total parameter count is far above what each token actually uses.

DFly2 drafter reusing Hy4 flash's KV cache and sparse indices

A built-in 0.85B drafter, DFly2, speeds up decoding through speculative generation, reusing the main model's KV cache and sparse indices so its overhead stays flat as context grows.

PropertyValue
Hidden size3,072
Layer pattern2 × sparse, then 10 × (3 × sliding-window → sparse)
Sparse / sliding-window layers12 / 30
Attention heads (sparse / sliding-window)32 / 64
Attention formulationMulti-head Latent Attention
Sliding window512 tokens
MoE latent dimension1,536
Dense FFN intermediate size13,824
Vision encoder27 layers, hidden size 1,152, 16 × 16 patches
Multimodal position encodingInterleaved MRoPE
Vocabulary120,832

Benchmarks

All figures here are Tencent's own, from evaluations Tencent designed and ran.

Performance and cost per task on WorkIndex

EvaluationResult
WorkIndex — internal benchmark of everyday productivity tasksHy4 flash 42.1 · Hy4 preview 39.7 · Hy4 51.4
Cost per WorkIndex taskAbout 1/13 of Hy4 preview and 1/20 of Hy4
Blind user evaluation — 85 users, 259 tasks2.79 / 4 satisfaction, against 2.81 for Claude Haiku 5.5
Output length after reinforcement learningAverage end-to-end output tokens cut by about half

In the blind evaluation, Tencent also reports the lowest cost per task and the shortest median completion time among the models tested.

Performance and cost per task on public agent benchmarks

The chart above covers seven public agent and reasoning benchmarks: DeepSWE, ProgramBench, Terminal-Bench 4.0, APEX-Agents, AutomationBench, Humanity's Last Exam and OSWorld 2.1. The complete scores are in the benchmark appendix.


When to choose it

Choose Hy4 flash for volume and speed: document processing, extraction and classification, search-and-summarise pipelines, routine agent steps, screenshot reading and first-pass drafting. With reasoning_effort: "none" it is a fast general-purpose worker; with reasoning on it handles multi-step tasks that a non-reasoning model would get wrong.

Choose Hy4 instead for complex, long-horizon software engineering, research-level reasoning and hard visual questions. Tencent states directly that Hy4 has the higher ceiling for that work.

A common pattern is to use both: Hy4 flash for the many cheap steps of a pipeline, Hy4 for the few hard ones.


Common pitfalls

SymptomCauseFix
HTTP 422 on reasoning_effort: "no_think"Not accepted on this endpointUse "none"
Simple requests are slower and cost more than expectedReasoning is on by defaultSend reasoning_effort: "none"
high or xhigh does not think harder than lowThe levels are not graded on this modelTreat reasoning as on or off
Empty content with finish_reason: "length"Reasoning consumed the token capRaise max_tokens, or turn reasoning off
Agent turn ends without a tool callSame causeRaise max_tokens
Unexpected results with several imagesTencent supports one image per requestSend one image per request

Limits to keep in mind

Hy4 flash trades ceiling for cost. Expect it to fall short of Hy4 on long, intricate coding tasks and on the hardest reasoning and vision problems.

Most of its published results come from Tencent's own internal benchmarks and user studies. They are a useful signal, but not an independent measurement — run your own task before committing to it at scale.

Like any language model it can produce confident, wrong statements. Verify facts that matter, and keep a person in the loop for consequential decisions.


References