ai-sage/GigaChat4-37B-A4B

Hugging Face Models Trending Models

Summary

ai-sage released GigaChat4-37B-A4B, a compact hybrid MoE model with 37B total/4B active parameters combining DeepSeek Sparse Attention and Gated DeltaNet, featuring a 1M-token context window, unified instant/reasoning modes, and FP8 instruction-tuned weights.

Task: text-generation Tags: safetensors, gigachat4, instruct, fp8, moe, multilingual, long-context, conversational, reasoning, agentic, tool-use, function-calling, structured-output, code, hybrid-attention, linear-attention, sparse-attention, speculative-decoding, mtp, dflash2, text-generation, custom_code, ru, en, base_model:ai-sage/GigaChat4-37B-A4B-bf16, base_model:quantized:ai-sage/GigaChat4-37B-A4B-bf16, license:other, region:us
Original Article
View Cached Full Text

Cached at: 11/28/26, 10:04 AM

ai-sage/GigaChat4-37B-A4B · Hugging Face

Source: https://huggingface.co/ai-sage/GigaChat4-37B-A4B

https://huggingface.co/ai-sage/GigaChat4-37B-A4B#gigachat-4-37b-a4bGigaChat 4 37B-A4B

Technical Report·Blog·Model Collection·SGLang Cookbook·GitHub

GigaChat 4 37B-A4B is a compact hybrid model in the GigaChat 4 family. It combines a Mixture-of-Experts (MoE) architecture with DeepSeek Sparse Attention (DSA) and Gated DeltaNet (GDN) with37Btotal parameters and4Bactive parameters per token. The model supports multilingual conversation, multi-step agentic tasks, tool calling, structured outputs, mathematical reasoning, coding, and question answering over long documents.

Unlike GigaChat 3.5, which offered separate instant and reasoning checkpoints, GigaChat 4 supports both modes within a single model, selectable per request. It features a one-million-token context window and supports speculative decoding with either a recurrent MTP drafter or a separate DFlash2 drafter.

This repository contains the final FP8 instruction-tuned model, which supports both instant and reasoning modes.

https://huggingface.co/ai-sage/GigaChat4-37B-A4B#model-variantsModel variants

https://huggingface.co/ai-sage/GigaChat4-37B-A4B#model-architectureModel architecture

GigaChat 4 extends the hybrid backbone of GigaChat 3.5 by adding DSA to its multi-head latent attention (MLA) layers.

PropertyValueTotal / active parameters per token37B / 4BDecoder layers / hidden size32 / 2,560Linear-attention / sparse-attention layers24 / 8Routed experts / active routed experts / shared experts192 / 8 / 1Initial decoder layers with dense FFNs1Maximum context length1,048,576 tokensDSA tokens selected per query2,048Built-in MTP layers1, reused recurrently

https://huggingface.co/ai-sage/GigaChat4-37B-A4B#mixture-of-experts-moeMixture-of-Experts (MoE)

This model has 37B total parameters, with 4B active per token. Each MoE layer combines an attention block with shared and routed experts, selecting 8 of 192 routed experts per token alongside a shared expert. GatedNorm is applied to block outputs before residual addition.

https://huggingface.co/ai-sage/GigaChat4-37B-A4B#hybrid-attentionHybrid attention

The model interleaves GatedDeltaNet and DSA layers in a 3:1 ratio. GatedDeltaNet maintains a fixed-size recurrent state for efficient processing, while DSA selectively attends to 2,048 earlier tokens per query, enabling retrieval of information from long contexts.

The context window was progressively extended from 32K to 128K and finally to 1M tokens. DSA was introduced at 128K through indexer-only training, followed by joint optimization of the indexer and backbone at 1M tokens.

https://huggingface.co/ai-sage/GigaChat4-37B-A4B#speculative-decodingSpeculative decoding

GigaChat 4 supports two approaches to speculative decoding:

  • **Recurrent MTP:**An EAGLE-3-style drafter that reuses a single prediction layer across draft steps, reducing drafter parameters by approximately 3× compared to GigaChat 3.5’s three independent MTP blocks without sacrificing draft quality.
  • **DFlash2:**A separate five-layer BF16 drafter that predicts tokens in parallel using blocks of eight positions: one anchor token and seven draft positions.

Both approaches accelerate autoregressive generation by allowing the target model to verify multiple draft tokens in a single forward pass.

https://huggingface.co/ai-sage/GigaChat4-37B-A4B#training-and-alignmentTraining and alignment

https://huggingface.co/ai-sage/GigaChat4-37B-A4B#pretraining-stabilityPretraining stability

GigaChat 4 37B builds on the training techniques used for the 708B model, with additional improvements to optimizer scaling and stability:

  • Muon with μP-based scalingwas used throughout pretraining and midtraining. We derived scaling rules for Muon’s weight updates that account for GatedDeltaNet and gated normalization, allowing hyperparameters tuned on a 4B model to transfer to 37B. During midtraining, we increased the number of Newton–Schulz iterations per optimizer step.
  • **Progressive residual warm-up (ProRes)**gradually increases residual branch contributions during early training, with deeper layers warming up more slowly to prevent activation growth.
  • Projection-specific z-loss and logit softcappingcontrol activation outliers and extreme output logits.
  • **Dynamic learning-rate rescaling (DLR)**adjusts learning rates for individual MoE blocks when persistent expert-load imbalance is detected, without affecting the rest of the model.

https://huggingface.co/ai-sage/GigaChat4-37B-A4B#alignmentAlignment

Following supervised fine-tuning, expert models were trained using reinforcement learning on mathematics, coding, tool use, and multi-turn agent workflows.

These experts were then consolidated into a single model through multi-teacher on-policy distillation, where the student generates its own responses and receives task-specific feedback from the corresponding teachers.

The resulting model supports both instant and reasoning modes within a single checkpoint.

For more details on the GigaChat 4 architecture and training methodology, see theGigaChat 4 technical report. A dedicated technical report for GigaChat 4 37B will be published later.

https://huggingface.co/ai-sage/GigaChat4-37B-A4B#evaluation-resultsEvaluation Results

The following tables summarize GigaChat 4 37B’s performance across a broad range of benchmarks. All scores are reported as percentages unless otherwise specified. A dash indicates an unreported result.

https://huggingface.co/ai-sage/GigaChat4-37B-A4B#reasoningReasoning

https://huggingface.co/ai-sage/GigaChat4-37B-A4B#codeCode

BenchmarkGigaChat 4 37BGigaChat 3.5 37BQwen3.5-35B-A3BQwen3.6-35B-A3BGigaChat 3.5 Ultra 432BLiveCodeBench v685.0064.0069.0065.0085.40SWE-bench Verified70.8032.4060.6067.8064.70SWE-bench Multilingual61.6726.0057.3060.70—NL2Repo (mean score / pass rate)14.89 / 25.033.20 / 3.4011.40 / 5.7030.30 / 17.705.00 / —Terminal-Bench 2.038.2022.5033.7048.3030.30Terminal-Bench 2.139.3322.5034.8049.40—

https://huggingface.co/ai-sage/GigaChat4-37B-A4B#generalGeneral

BenchmarkGigaChat 4 37BGigaChat 3.5 37BQwen3.5-35B-A3BQwen3.6-35B-A3BGigaChat 3.5 Ultra 432BIFBench (prompt-level loose)75.0061.0064.3058.0077.00JSONSchemaBench96.0087.0094.2042.0093.01StructEval Text86.0075.0078.9085.6085.00POLLUX—73.0068.6071.0075.50GraphWalks63.0013.0060.5046.0038.00Natural Plan92.0051.0075.2076.0080.19NIH Complex99.0094.0096.9067.0099.16AA-LCR54.0018.7066.0060.7025.00

https://huggingface.co/ai-sage/GigaChat4-37B-A4B#stemSTEM

BenchmarkGigaChat 4 37BGigaChat 3.5 37BQwen3.5-35B-A3BQwen3.6-35B-A3BGigaChat 3.5 Ultra 432BGPQA Diamond70.0066.0085.0080.0082.30HMMT (pass@8)95.0086.7087.0083.0093.00HMMT (mean@8)87.0061.5074.0070.00—AIME 2025 (pass@8)93.0080.0093.0093.0093.00AIME 2025 (mean@8)88.0073.0088.0092.0089.00AIME 2026 (pass@8)93.0093.0097.0097.0097.00AIME 2026 (mean@8)92.0078.0088.0087.0091.00IMO-AnswerBench76.0060.0074.0076.0073.00HLE (text only)9.006.0019.0020.0013.00

https://huggingface.co/ai-sage/GigaChat4-37B-A4B#agenticAgentic

BenchmarkGigaChat 4 37BGigaChat 3.5 37BQwen3.5-35B-A3BQwen3.6-35B-A3BGigaChat 3.5 Ultra 432BBFCL (overall accuracy)72.0063.0069.0067.0058.59τ³-Bench (mean@3)57.0041.2053.6063.3047.80τ²-Bench (mean@3)73.0053.4069.4080.0061.58τ³-Bench Banking (mean@3)9.004.806.208.608.93CoworkBench (Pi)59.485.8039.0057.0025.00Toolathlon39.0018.9040.0042.001.41SkillsBench (without skills)8.621.209.0014.00—SkillsBench (with skills)23.803.7025.0035.00—JobBench23.282.509.1017.10—

https://huggingface.co/ai-sage/GigaChat4-37B-A4B#instantInstant

https://huggingface.co/ai-sage/GigaChat4-37B-A4B#code-1Code

BenchmarkGigaChat 4 37BGigaChat 3.5 37BQwen3.5-35B-A3BQwen3.6-35B-A3BGigaChat 3.5 Ultra 432BLiveCodeBench v652.0049.0057.6346.4556.20SWE-bench Verified70.8034.0057.8063.4039.70SWE-bench Multilingual61.677.0054.3059.7021.60Terminal-Bench 2.038.205.60*36.0044.90*12.94Terminal-Bench 2.139.337.9046.1046.10*—

https://huggingface.co/ai-sage/GigaChat4-37B-A4B#general-1General

BenchmarkGigaChat 4 37BGigaChat 3.5 37BQwen3.5-35B-A3BQwen3.6-35B-A3BGigaChat 3.5 Ultra 432BIFBench (prompt-level loose)48.0035.0041.3037.3043.66JSONSchemaBench86.0085.0091.0092.1083.94StructEval Text87.0072.0083.8082.4074.35POLLUX—70.0065.10—74.25GraphWalks26.007.0056.2055.6019.99Natural Plan45.0021.0044.1044.6066.42NIH Complex92.0082.0096.6099.9997.11AA-LCR54.0010.7052.7052.3027.60

https://huggingface.co/ai-sage/GigaChat4-37B-A4B#stem-1STEM

BenchmarkGigaChat 4 37BGigaChat 3.5 37BQwen3.5-35B-A3BQwen3.6-35B-A3BGigaChat 3.5 Ultra 432BGPQA Diamond55.0058.0078.3081.8061.11HMMT (pass@8)67.0073.3071.7080.0055.00HMMT (mean@8)—46.9049.8056.70—AIME 2025 (pass@8)73.0067.0093.3090.0093.00AIME 2025 (mean@8)39.0050.0076.3072.5068.00AIME 2026 (pass@8)80.0077.0093.3093.3083.00AIME 2026 (mean@8)57.0055.0071.3076.3067.00IMO-AnswerBench35.0044.0059.2056.0032.00HLE (text only)4.004.0012.2012.904.00

https://huggingface.co/ai-sage/GigaChat4-37B-A4B#agentic-1Agentic

BenchmarkGigaChat 4 37BGigaChat 3.5 37BQwen3.5-35B-A3BQwen3.6-35B-A3BGigaChat 3.5 Ultra 432BBFCL (overall accuracy)49.0037.0057.8055.0051.57τ³-Bench (mean@3)47.3040.8060.2059.4050.04τ²-Bench (mean@3)60.0054.0078.5078.0068.71τ³-Bench Banking (mean@3)10.002.10*5.503.805.15

https://huggingface.co/ai-sage/GigaChat4-37B-A4B#evaluation-notesEvaluation Notes

IFBench uses prompt-level loose scoring. NL2Repo entries report mean score / pass rate, in that order. HLE uses the text subset.

https://huggingface.co/ai-sage/GigaChat4-37B-A4B#usageUsage

https://huggingface.co/ai-sage/GigaChat4-37B-A4B#sglangSGLang

GigaChat 4 is natively supported inSGLang, including recurrent MTP and DFlash2 speculative decoding, per-request instant/reasoning mode selection, and tool calling.

For detailed deployment instructions, hardware configurations, API examples, and performance benchmarks, see theGigaChat 4 SGLang cookbook.

The deployment recipe below was tested on SGLang commitff14289793.

Installation

python3 -m pip install \
  "sglang @ git+https://github.com/sgl-project/sglang.git@ff142897935ec6ede004dea8439d6111110bd446#subdirectory=python"

Deployment

The FP8 model can be deployed on a single H100 80GB GPU (TP1). The model weights require approximately 40 GB of GPU memory, with additional memory needed for attention caches, recurrent states, and activations.

sglang serve \
  --model-path ai-sage/GigaChat4-37B-A4B \
  --tp 1 \
  --mem-fraction-static 0.8 \
  --max-running-requests 64 \
  --cuda-graph-max-bs-decode 64 \
  --reasoning-parser auto \
  --tool-call-parser auto \
  --speculative-algorithm EAGLE \
  --speculative-num-steps 3 \
  --speculative-eagle-topk 1 \
  --speculative-num-draft-tokens 4 \
  --host 0.0.0.0 \
  --port 30000

This configuration enables recurrent MTP speculative decoding using the built-in draft head. For DFlash2 deployment and alternative serving configurations, refer to the cookbook.

Instant and reasoning modes

Both modes are available through the same OpenAI-compatible API. Setchat\_template\_kwargs\.reasoningtofalsefor instant mode ortruefor reasoning mode.

curl http://localhost:30000/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "ai-sage/GigaChat4-37B-A4B",
    "messages": [
      {"role": "user", "content": "What is 17 times 24?"}
    ],
    "temperature": 1.0,
    "top_p": 1.0,
    "repetition_penalty": 1.0,
    "max_tokens": 4096,
    "chat_template_kwargs": {"reasoning": false}
  }'

The chat template enables reasoning by default when the argument is omitted. With the reasoning parser enabled, the response separates thinking intomessage\.reasoning\_contentand the final answer intomessage\.content.

For tool calling, multi-turn conversations, streaming, and advanced inference settings, see theSGLang cookbook.

https://huggingface.co/ai-sage/GigaChat4-37B-A4B#vllmvLLM

GigaChat 4 supports inference withvLLM, including recurrent MTP and DFlash2 speculative decoding, per-request instant/reasoning mode selection, and tool calling.

The following example uses vLLM commitc0c9083from theGigaChat 4 integration PR.

Installation

git clone https://github.com/vllm-project/vllm.git
cd vllm
git fetch origin c0c90837262bf3059b3d7b20bf120ffbe197a785
git checkout --detach c0c90837262bf3059b3d7b20bf120ffbe197a785

python3 -m pip install --upgrade pip
VLLM_USE_PRECOMPILED=1 python3 -m pip install -e .

Deployment

The example below uses a single H100 80GB GPU (TP1) with recurrent MTP speculative decoding enabled.

vllm serve ai-sage/GigaChat4-37B-A4B \
  --tensor-parallel-size 1 \
  --no-numa-bind \
  --gpu-memory-utilization 0.90 \
  --max-num-seqs 64 \
  --compilation-config '{"max_decode_cudagraph_capture_requests": 64}' \
  --tool-call-parser gigachat4 \
  --enable-auto-tool-choice \
  --reasoning-parser gigachat4 \
  --speculative-config '{"method":"mtp","num_speculative_tokens":3}' \
  --host 0.0.0.0 \
  --port 8000

Instant and reasoning modes

Both modes are available through the same OpenAI-compatible API. Setchat\_template\_kwargs\.reasoningtofalsefor instant mode ortruefor reasoning mode.

curl http://localhost:8000/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "ai-sage/GigaChat4-37B-A4B",
    "messages": [
      {"role": "user", "content": "Prove that the sum of the first n odd positive integers is n**2. Write a proof in the style of Eminem’s lyrics."}
    ],
    "max_tokens": 8192,
    "temperature": 1.0,
    "top_p": 1.0,
    "chat_template_kwargs": {"reasoning": true}
  }'

The chat template enables reasoning by default when the argument is omitted. With the reasoning parser enabled, the response separates thinking intomessage\.reasoningand the final answer intomessage\.content. Themax\_tokenslimit covers both.

Tool calling

The following example demonstrates tool calling in reasoning mode using the OpenAI-compatible Chat Completions API.

curl http://localhost:8000/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "ai-sage/GigaChat4-37B-A4B",
    "messages": [
      {"role": "user", "content": "What is the weather in London right now?"}
    ],
    "tools": [
      {
        "type": "function",
        "function": {
          "name": "get_weather",
          "description": "Get the current weather in a city",
          "parameters": {
            "type": "object",
            "properties": {
              "city": {"type": "string"}
            },
            "required": ["city"]
          }
        }
      }
    ],
    "tool_choice": "auto",
    "max_tokens": 2000,
    "temperature": 0.6,
    "chat_template_kwargs": {"reasoning": true}
  }'

When the model requests a tool, the response contains the function name and arguments inmessage\.tool\_calls. Execute the function in your application, append the assistant message and atoolmessage with the matchingtool\_call\_id, then request the final answer.

https://huggingface.co/ai-sage/GigaChat4-37B-A4B#recommended-agent-harnessesRecommended agent harnesses

We recommend Pi for agentic tasks with GigaChat 4 37B-A4B. Codex CLI and DeepSeek Harness are alternatives for interactive terminal work. You can use each harness’s standard prompts and tools without fine-tuning the checkpoint for that harness.

We verified interactive shell tool calls on an internal checkpoint with Pi 1.6.0, Codex CLI 0.171.0, and DeepSeek Harness 0.2.2-rc.5. Pi and DeepSeek Harness connected directly through Chat Completions. Codex used a Responses-to-Chat-Completions gateway.

The examples below use the SGLang base URLhttp://127\.0\.0\.1:30000/v1and the FP8 model IDai\-sage/GigaChat4\-37B\-A4B. For the vLLM deployment above, the base URL ishttp://127\.0\.0\.1:8000/v1. If you set a custom served name, use the model ID returned byGET /v1/models.

HarnessAPI used by the harnessRequired endpointPiOpenAI Chat CompletionsPOST /v1/chat/completionsCodex CLIOpenAI ResponsesPOST /v1/responsesDeepSeek HarnessOpenAI Chat CompletionsPOST /v1/chat/completions

https://huggingface.co/ai-sage/GigaChat4-37B-A4B#piPi

Addgigachatto theprovidersobject in~/\.pi/agent/models\.json.

{
  "providers": {
    "gigachat": {
      "baseUrl": "http://127.0.0.1:30000/v1",
      "api": "openai-completions",
      "apiKey": "$GIGACHAT_API_KEY",
      "models": [
        { "id": "ai-sage/GigaChat4-37B-A4B" }
      ]
    }
  }
}

Pi readsGIGACHAT\_API\_KEYfrom the environment. Export your endpoint’s key, or useexport GIGACHAT\_API\_KEY=localfor an unauthenticated local server. Runpifrom your project directory and select GigaChat 4 37B-A4B with/model.

https://huggingface.co/ai-sage/GigaChat4-37B-A4B#codex-cliCodex CLI

Codex requires a Responses API endpoint that can stream tool calls and accept tool results on subsequent requests. Connect directly if your deployment supports the tool types sent by your Codex version. If it serves only Chat Completions or rejects those tool types, setbase\_urlto the API root of a compatible Responses-to-Chat-Completions gateway.

For Codex CLI 0.134.0 and later, save this profile as~/\.codex/gigachat\.config\.toml.

model = "ai-sage/GigaChat4-37B-A4B"
model_provider = "gigachat"

[model_providers.gigachat]
name = "GigaChat 4"
base_url = "http://127.0.0.1:30000/v1"
wire_api = "responses"

For an authenticated endpoint, addenv\_key = "GIGACHAT\_API\_KEY"under\[model\_providers\.gigachat\]and export the key. If your gateway rejects the built-inweb\_searchtool, addweb\_search = "disabled"at the top level, above\[model\_providers\.gigachat\]. We used this setting with our gateway.

Codex CLI before 0.134.0Put both sections in~/\.codex/config\.toml.

[model_providers.gigachat]
name = "GigaChat 4"
base_url = "http://127.0.0.1:30000/v1"
wire_api = "responses"

[profiles.gigachat]
model = "ai-sage/GigaChat4-37B-A4B"
model_provider = "gigachat"

When upgrading, move the profile settings into~/\.codex/gigachat\.config\.toml, then remove the old\[profiles\.gigachat\]section and any top-levelprofile = "gigachat"setting from the base file.

Start an interactive session from your project directory.

codex --profile gigachat

https://huggingface.co/ai-sage/GigaChat4-37B-A4B#deepseek-harnessDeepSeek Harness

For the interactive terminal UI, install the tested launcher and plugin versions.

npm install -g @deepseek-ai/[email protected]
dsh plugin --profile tui add @deepseek-harness-tui/[email protected]

Save the following asgigachat\-dsh\.yml. The interactive TUI and the headless CLI use the same configuration.

- id: llm-pi-ai
  config:
    providers:
      gigachat:
        api: openai-completions
        baseURL: http://127.0.0.1:30000/v1
        apiKeyEnv: GIGACHAT_API_KEY
        models:
          - id: ai-sage/GigaChat4-37B-A4B

- id: agent-default-model
  config:
    provider: gigachat
    model: ai-sage/GigaChat4-37B-A4B

ExportGIGACHAT\_API\_KEYwith your endpoint’s key, or set it tolocalfor an unauthenticated server. Launch the TUI from the directory containing the configuration.

dsh --profile tui --patch ./gigachat-dsh.yml

https://huggingface.co/ai-sage/GigaChat4-37B-A4B#verify-the-connection-and-tool-callingVerify the connection and tool calling

To check that the harness can reach the model, execute a tool, and return its output to the model, ask this question in an interactive session:

How much RAM is available on this machine right now?

The model chooses how to inspect memory. Look for a shell tool call in the session and check that the answer matches the available RAM in the command output.

You can run the same check from a script with the DeepSeek Harness headless CLI.

dsh --profile headless --patch ./gigachat-dsh.yml \
  'How much RAM is available on this machine right now?'

https://huggingface.co/ai-sage/GigaChat4-37B-A4B#licenseLicense

GigaChat 4 37B-A4B is released under theNoncommercial License for individuals 1.0.

Similar Articles

ai-sage/GigaChat4-708B-A41B

Hugging Face Models Trending

GigaChat 4 是 GigaChat 家族的旗舰混合模型,采用 708B 总参数 / 41B 激活参数的 MoE 架构,结合 DeepSeek Sparse Attention 与 Gated DeltaNet,支持 100 万 token 上下文、即时与推理双模式以及多种投机解码方案。

ai-sage/GigaChat3.5-Omni-432B-A28B · Hugging Face

Reddit r/LocalLLaMA

GigaChat 3.5 Omni is a 432B Mixture-of-Experts multimodal model (28B active params) that accepts text, images, audio, and video with soundtrack, released as an FP8 checkpoint for SGLang inference with strong video benchmark results.

ai-sage/GigaChat3.1-Audio-10B-A1.8B · Hugging Face

Reddit r/LocalLLaMA

GigaChat Audio 10B is an audio-native LLM built on GigaChat 3.1 Lightning, integrating a Conformer speech encoder and modality adapter for audio question answering, temporal grounding, and tool use.