ModelsQwenQwen3.8-Flash
providerQwen /

Qwen3.8-Flash

40 DZD in 140 DZD out 5 DZD cached/ 1M tokens

Qwen3.8-Flash is a multimodal Mixture-of-Experts model and an early preview of the architecture behind Qwen4. It carries 125 billion main parameters plus a separate 51-billion-parameter N-gram embedding table, yet activates only 6 billion per token — under five percent — through a hybrid attention design where three of every four layers compress history and the fourth retrieves from it precisely. The result is a model that reads text, images, and video across a one-million-token context at a per-token cost closer to a small model than a large one. Thinking is on by default and switchable off, and the whole design targets agentic coding, long-document work, and video analysis.

PublicJSONMultimodalVisionVideoStreaming
Qwen3.8-Flash
Capabilities
ToolsReasoning (optional)Structured output
ArchitectureMultimodal MoE
Context Window1M

Use Qwen3.8-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

Qwen3.8-Flash

A multimodal Mixture-of-Experts model, and an early preview of the architecture that will underpin Qwen4.


The Numbers Are Unusual

Main model125B parameters
N-gram embedding table51B parameters, held separately
Activated per token6B
Context1,000,000 tokens
ModalityText, image, video in → text out

Under five percent of the main model works on any given token. That ratio is aggressive even by current standards, and it is the point of the architecture rather than a side effect.

The 51B embedding table is the more unusual entry. It is capacity that costs almost nothing per token — a lookup indexed by local context rather than a set of weights that must be multiplied through. It can be offloaded to host memory and prefetched asynchronously, which means it adds knowledge without adding the compute that knowledge normally requires.


What Changed Architecturally

Four components were reworked together. Each addresses a specific cost.

Hybrid attention: GDN + QSA. Three of every four layers use Gated DeltaNet to compress history into a constant-size state. The fourth uses Qwen Sparse Attention, which selects important context at micro-block granularity rather than token by token.

That granularity choice is the practical one. Selecting individual tokens is itself expensive at long context; selecting blocks cuts the selection cost while keeping retrieval precise enough. The result is substantially lower long-context latency — which matters because agentic workloads are long-context workloads by nature.

Gated Residual. The residual stream is widened into four branches, with a data-dependent read gate and a per-branch write gate controlling what flows between layers. This strengthens cross-layer information flow and training stability at depth.

N-gram Embedding. A lookup table indexed by local context, scaling capacity with very little extra computation, offloadable to host memory.

Multi-Token Prediction. A built-in module supporting speculative decoding.

Compared with the previous generation, training cost fell to roughly one ninth while capability on coding and office tasks improved.


Thinking Is On by Default

Reasoning is enabled unless you turn it off. For classification, routing, extraction, and formatting — where deliberation adds latency and nothing else — switch it off explicitly.

JSON
{ "chat_template_kwargs": { "enable_thinking": false } }

Reasoning tokens count against your output budget. On a long analytical request the trace can consume a significant share of it before the answer begins, so size the ceiling to the mode you selected rather than to the answer you expect.


Specifications

Model IDQwen/Qwen3.8-Flash
Main parameters125B
N-gram embeddings51B
Activated per token6B
Context window1,000,000 tokens
InputText, image, video
OutputText
ReasoningOn by default, switchable
Tool callingSupported
Speculative decodingMulti-Token Prediction module included

Reported maximum output length varies between sources. Confirm the ceiling on your own path before building around a figure.


Capabilities

CapabilityValue
input_typestext, image, video
output_typestext
context_window1000000
reasoningOn by default, switchable off
reasoning_fieldreasoning_content — separate from content
streamingSupported
tool_callingSupported
structured_outputSupported
requires_promptYes — text prompt required, media optional

Two Models, Similar Names

Worth knowing, because the distinction changes what you get.

Qwen3.8-Flash-NextQwen3.8-Flash
What it isExperimental open-weight previewProduction version
Native context262,144, extensible with RoPE scaling1,000,000 by default
Built-in tools—Included
WeightsPublishedHosted

Same underlying model, different configuration. Documentation, benchmarks, and community discussion frequently refer to the open-weight preview — read specifications carefully when comparing, because the context figures differ by a factor of four.


Using Qwen3.8-Flash on DEVUP AI

Base URL: https://api.devupai.com/v1 · Model ID: Qwen/Qwen3.8-Flash

Quick start — cURL

BASH
curl https://api.devupai.com/v1/chat/completions \
  -H "Authorization: Bearer $DEVUP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "Qwen/Qwen3.8-Flash",
    "messages": [
      {
        "role": "user",
        "content": "Two services write to the same row without a transaction. Walk through the failure modes in order of likelihood and propose the smallest fix for each."
      }
    ],
    "temperature": 1.0,
    "top_p": 0.95,
    "max_tokens": 32768
  }'

Reading a whole codebase — Python

The workload the sparse architecture was built to make affordable.

PYTHON
import os
from pathlib import Path
from openai import OpenAI

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

sources = "\n\n".join(
    f"=== {path} ===\n{path.read_text(encoding='utf-8')}"
    for path in sorted(Path("src").rglob("*.py"))
)

response = client.chat.completions.create(
    model="Qwen/Qwen3.8-Flash",
    messages=[
        {
            "role": "system",
            "content": (
                "You are auditing a codebase. Identify every database write that occurs outside "
                "a transaction. Cite the file and function for each finding. Report nothing you "
                "cannot point to."
            ),
        },
        {"role": "user", "content": sources},
    ],
    temperature=1.0,
    top_p=0.95,
    max_tokens=32768,
    extra_body={"top_k": 20},
)

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

Passing the repository whole rather than chunking it is the point. Cross-file relationships — a helper called from three places, a transaction opened in one module and committed in another — are invisible to a chunked pipeline and are exactly what this kind of audit is looking for.

Video analysis — Python

PYTHON
response = client.chat.completions.create(
    model="Qwen/Qwen3.8-Flash",
    messages=[
        {
            "role": "user",
            "content": [
                {"type": "video_url", "video_url": {"url": "https://example.com/session.mp4"}},
                {
                    "type": "text",
                    "text": (
                        "List every UI action the user performs, in order, with timestamps. "
                        "Describe only what is visible on screen."
                    ),
                },
            ],
        }
    ],
    temperature=1.0,
    top_p=0.95,
    max_tokens=16384,
    extra_body={"top_k": 20},
)

Video consumes input tokens rapidly. A long recording at a high frame rate can fill a substantial portion of even a million-token window, so start with a short clip and measure before processing an archive.

Document and chart understanding — Python

PYTHON
import base64

with open("quarterly_report_page.png", "rb") as handle:
    encoded = base64.b64encode(handle.read()).decode("utf-8")

response = client.chat.completions.create(
    model="Qwen/Qwen3.8-Flash",
    messages=[
        {
            "role": "user",
            "content": [
                {"type": "image_url", "image_url": {"url": f"data:image/png;base64,{encoded}"}},
                {
                    "type": "text",
                    "text": (
                        "Read every figure in the chart and report it with its label and axis unit. "
                        "Where a value is not printed and must be read off the axis, say so. "
                        "Use null for anything illegible — do not estimate."
                    ),
                },
            ],
        }
    ],
    temperature=1.0,
    top_p=0.95,
    max_tokens=8192,
    extra_body={"top_k": 20},
)

Distinguishing a printed figure from one read off an axis is worth asking for. The first is transcription; the second is interpretation, and only one of them belongs in a spreadsheet without review.

Fast path without thinking — Python

PYTHON
response = client.chat.completions.create(
    model="Qwen/Qwen3.8-Flash",
    messages=[
        {"role": "system", "content": "Classify the ticket. Reply with exactly one word: billing, technical, shipping, or other."},
        {"role": "user", "content": ticket},
    ],
    temperature=0.7,
    top_p=0.80,
    max_tokens=16,
    extra_body={
        "top_k": 20,
        "chat_template_kwargs": {"enable_thinking": False},
    },
)

Note the different sampling values. Qwen publishes separate parameter sets for thinking and non-thinking modes; switching the mode without switching the sampling leaves quality on the table.

Agent loop — Python

PYTHON
import json

for _ in range(30):  # bounded loop — always give an agent an iteration ceiling
    response = client.chat.completions.create(
        model="Qwen/Qwen3.8-Flash",
        messages=messages,
        tools=TOOLS,
        temperature=1.0,
        top_p=0.95,
        max_tokens=32768,
        extra_body={"top_k": 20},
    )

    message = response.choices[0].message
    messages.append(
        {
            "role": "assistant",
            "content": message.content,
            "reasoning_content": getattr(message, "reasoning_content", None),
            "tool_calls": message.tool_calls,
        }
    )

    if not message.tool_calls:
        print(message.content)
        break

    for call in message.tool_calls:
        handler = HANDLERS.get(call.function.name)
        if handler is None:
            result = {"error": "unknown_tool", "name": call.function.name}
        else:
            try:
                result = handler(**json.loads(call.function.arguments or "{}"))
            except Exception as exc:
                # Return the failure as data — the model can adapt to it.
                result = {"error": type(exc).__name__, "detail": str(exc)}

        messages.append({"role": "tool", "tool_call_id": call.id, "content": json.dumps(result)})
else:
    print("Agent loop exceeded its iteration limit.")

Keep reasoning_content in its own field when replaying history. Merging it into content presents the model's private reasoning back to it as though it were the published answer.

Node.js — DEVUP AI SDK

BASH
npm install devupai
JAVASCRIPT
import DevupAI from "devupai";

const client = new DevupAI({
  apiKey: process.env.DEVUP_API_KEY,
});

const response = await client.chat.completions.create({
  model: "Qwen/Qwen3.8-Flash",
  messages: [
    {
      role: "system",
      content:
        "Review this migration plan. Report only defects that would cause data loss or " +
        "downtime, each with a severity and the smallest safe fix.",
    },
    { role: "user", content: migrationPlan },
  ],
  temperature: 1.0,
  top_p: 0.95,
  max_tokens: 32768,
});

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

Streaming

PYTHON
stream = client.chat.completions.create(
    model="Qwen/Qwen3.8-Flash",
    messages=[{"role": "user", "content": "Design a retry policy for a webhook delivery system."}],
    temperature=1.0,
    top_p=0.95,
    max_tokens=32768,
    stream=True,
    extra_body={"top_k": 20},
)

for chunk in stream:
    if not chunk.choices:
        if getattr(chunk, "usage", None):
            print(f"\n\nin {chunk.usage.prompt_tokens} / out {chunk.usage.completion_tokens}")
        continue

    delta = chunk.choices[0].delta
    if getattr(delta, "content", None):
        print(delta.content, end="", flush=True)

With thinking on by default, watching the split between reasoning tokens and answer tokens is how you find out whether your output budget is actually sufficient.


Recommended Generation Parameters

Two sets. Switching mode means switching all of them, not just the toggle.

ParameterThinkingNon-thinking
temperature1.00.7
top_p0.950.80
top_k2020

Support for top_k varies by serving stack.

Budget output generously on agentic work. Reasoning tokens share the output ceiling with the answer, and truncating mid-trace produces an unfinished response rather than a shorter one.


Where It Fits

Agentic coding. The architecture was built for it — long, tool-heavy sessions where context accumulates faster than output. The micro-block attention design specifically targets that latency.

Whole-repository and whole-corpus work. A million tokens holds a codebase, a document set, or a log archive without a retrieval layer in front of it.

Visual and document understanding. Charts, scanned pages, screenshots, and interfaces, read alongside the text around them.

Long-video analysis. One of the stated design targets, and uncommon at this activation cost.

High-throughput production traffic. Six billion activated parameters is what makes this viable as a default rather than an escalation tier.


Practical Notes

Turn thinking off where it adds nothing. Classification, routing, and formatting do not improve with deliberation.

Switch the whole sampling set with the mode.

Measure media token consumption before scaling. Video and high-resolution images consume input tokens far faster than text, and a million-token window fills faster than it sounds.

Keep reasoning_content in its own field in both directions.

Feed long documents whole where they fit. Chunking discards the cross-references this model is good at finding.

Instruct it to return null rather than infer on extraction tasks. An invented figure is undetectable downstream.

Bound every agent loop with an iteration ceiling.


Limitations

  • Text output only. It reads images and video but does not generate them.
  • Thinking is on by default, and the trace shares your output budget.
  • Reported output ceilings vary between sources. Confirm the figure on your own path.
  • Media fills context quickly. Video and high-resolution imagery are expensive in input tokens regardless of the model's efficiency per token.
  • Sampling parameter support varies by serving stack. top_k in particular is not universally honoured.
  • An architecture preview. This generation is an early look at a design still under development; behaviour may differ from the mature version in ways not yet documented.
  • Not a safety layer. Apply your own moderation and validation before acting on model output in a production system.