GigaChat 3.1 Lightning
GigaChat 3.1 Lightning is the compact instruct model of the GigaChat 3.1 family. It is a Mixture-of-Experts (MoE) model with 10B total parameters and 1.8B active parameters, designed for fast multilingual assistant workloads, reasoning, code, function calling, and product-style deployment.
This repository contains the FP8 version of the model. The BF16 checkpoint is available at
GigaChat3.1-10B-A1.8B-bf16, and a GGUF version is available at
GigaChat3.1-10B-A1.8B-GGUF.
More details can be found in the
Habr article.
Model architecture
GigaChat 3.1 Lightning uses a custom MoE architecture with the following key components.
Mixture-of-Experts (MoE)
The model has 10B total parameters with 1.8B active parameters at inference time. This allows it to scale model capacity aggressively while keeping the active compute budget much lower than that of an equally large dense model.
Multi-head Latent Attention (MLA)
Instead of standard multi-head attention, the model uses MLA, which compresses the KV cache into a latent representation. This reduces memory usage and improves inference throughput, especially in long-context settings.
Multi-Token Prediction (MTP)
The model is trained with MTP, which allows it to predict multiple tokens per forward pass. In production systems, this can be used with speculative or parallel decoding techniques to improve throughput.
Training data
The base GigaChat 3 training corpus spans 10 languages and includes books, academic material, code datasets, and mathematics datasets. All data goes through deduplication, language filtering, and automatic quality checks based on heuristics and classifiers.
Synthetic data remains a major contributor to quality. Across the broader training corpus, we used approximately 5.5 trillion synthetic tokens, including:
- question-answer data generated from source texts,
- reverse-prompt chains for structured data generation,
- model-authored notes embedded inside texts,
- millions of synthetic tasks with solutions in mathematics and olympiad-style programming,
- synthetic tests for code and reasoning tasks.
For the 3.1 release, we made major data improvements:
- Hard-domain expansion at Stage 1.5: stronger coverage of mathematics, finance, physics, engineering, biology, chemistry, and medicine.
- Stricter quality validation: our internal
Revisor pipeline was extended with stronger checks for Markdown, LaTeX, and answer-format correctness.
- LLM-judge validation: SFT and DPO data is validated with judges selected for the task type and response structure.
- On-policy DPO data: preference pairs were generated from preview-model behavior, making them better aligned with real model failure modes.
- Better product-oriented data: we expanded data for search-and-citation scenarios, file-aware code interpretation, personalization, and agentic dialogues with executable tool calls.
- Improved answer style: we also revised formatting and writing guidelines to improve readability, correctness, and overall response quality.
Post-training improvements
DPO in native FP8
Unlike the preview release, GigaChat 3.1 Lightning includes a full DPO stage. This stage was redesigned for the MoE setup and trained in native FP8, not just quantized after training.
Important changes include:
- MTP heads trained during DPO for better consistency between main-model predictions and MTP predictions,
- weighted gamma with exponential decay over long sequences,
- stronger tuning of batch size and DPO contribution,
- better robustness against loop-inducing failure modes.
In our experiments, native FP8 DPO not only recovered the quality that could be lost with post-training FP8 quantization, but in some cases even exceeded the BF16 result while using substantially less memory.
Faster post-training
We also optimized the SFT pipeline with a combination of sequence packing, dynamic sequence parallelism, and additional pipeline optimizations. This reduced training cost significantly and improved GPU utilization, especially on long-context workloads.
Inference
One of the key advantages of
GigaChat3.1-10B-A1.8B is its inference speed. The model (especially in MTP mode) demonstrates throughput comparable to that of significantly smaller dense models.
We measured this using vllm 0.17.1rc1.dev158+g600a039f5, concurrency=32, 1xH100 80gb SXM5.
Link to code.
| Model | Output tps | Total tps | TPOT | Diff vs Lightning BF16 |
|---|
| GigaChat-3.1-Lightning BF16 | 2 866 | 5 832 | 9.52 | +0.0% |
| GigaChat-3.1-Lightning BF16 + MTP | 3 346 | 6 810 | 8.25 | +16.7% |
| GigaChat-3.1-Lightning FP8 | 3 382 | 6 883 | 7.63 | +18.0% |
| GigaChat-3.1-Lightning FP8 + MTP | 3 958 | 8 054 | 6.92 | +38.1% |
| YandexGPT-5-Lite-8B | 3 081 | 6 281 | 7.62 | +7.5% |
Benchmark Results
| Domain | Metric | GigaChat-3-Lightning | GigaChat-3.1-Lightning | Qwen3-1.7B-Instruct | Qwen3-4B-Instruct | SmolLM3 | gemma-3-4b-it |
|---|
| General | MMLU RU | 0.683 | 0.6803 | - | 0.597 | 0.500 | 0.519 |
| General | RUBQ | 0.652 | 0.6646 | - | 0.317 | 0.636 | 0.382 |
| General | MMLU PRO | 0.606 | 0.6176 | 0.410 | 0.685 | 0.501 | 0.410 |
| General | MMLU EN | 0.740 | 0.7298 | 0.600 | 0.708 | 0.599 | 0.594 |
| General | BBH | 0.453 | 0.5758 | 0.3317 | 0.717 | 0.416 | 0.131 |
| General | SuperGPQA | 0.273 | 0.2939 | 0.209 | 0.375 | 0.246 | 0.201 |
| Code | Human Eval Plus | 0.695 | 0.7317 | 0.628 | 0.878 | 0.701 | 0.713 |
| Total | Average | 0.586 | 0.631 | 0.458 | 0.612 | 0.514 | 0.421 |
Arena Results
| Arena | GigaChat-2-Lite-30.1 | GigaChat-3-Lightning | GigaChat-3.1-Lightning | YandexGPT-5-Lite-8B | SmolLM3 | gemma-3-4b-it | Qwen3-4B | Qwen3-4B-Instruct-2507 |
|---|
| Arena Hard Logs V3 | 23.700 | 14.3 | 46.700 | 17.9 | 18.1 | 38.7 | 27.7 | 61.5 |
| Validator SBS Pollux | 32.500 | 24.3 | 55.700 | 10.3 | 13.7 | 34.000 | 19.8 | 56.100 |
| Total Average | 28.100 | 19.3 | 51.200 | 14.1 | 15.9 | 36.35 | 23.75 | 58.800 |
Usage Example
1. transformers
1import torch
2from transformers import AutoTokenizer, AutoModelForCausalLM, GenerationConfig
3
4model_name = "ai-sage/GigaChat3.1-10B-A1.8B"
5tokenizer = AutoTokenizer.from_pretrained(model_name)
6model = AutoModelForCausalLM.from_pretrained(
7 model_name,
8 torch_dtype=torch.bfloat16,
9 device_map="auto",
10)
11model.generation_config = GenerationConfig.from_pretrained(model_name)
12messages = [
13 {"role": "user", "content": "Докажи теорему о неподвижной точке"}
14]
15prompt = tokenizer.apply_chat_template(
16 messages,
17 tokenize=False,
18 add_generation_prompt=True,
19)
20inputs = tokenizer(prompt, return_tensors="pt")
21inputs = {k: v.to(model.device) for k, v in inputs.items()}
22outputs = model.generate(
23 **inputs,
24 max_new_tokens=1000,
25)
26prompt_len = inputs["input_ids"].shape[1]
27result = tokenizer.decode(
28 outputs[0][prompt_len:],
29 skip_special_tokens=True,
30)
31print(result)
2. vLLM
Start the server
1vllm serve ai-sage/GigaChat3.1-10B-A1.8B \
2 --dtype "auto" \
3 --speculative-config '{"method": "mtp", "num_speculative_tokens": 1, "disable_padded_drafter_batch": false}'
Request example
1curl http://localhost:8000/v1/chat/completions \
2 -H "Content-Type: application/json" \
3 -d '{
4 "model": "ai-sage/GigaChat3.1-10B-A1.8B",
5 "messages": [
6 {
7 "role": "user",
8 "content": "Докажи теорему о неподвижной точке"
9 }
10 ],
11 "max_tokens": 400,
12 "temperature": 0
13 }'
3. SGLang
Start the server
1python -m sglang.launch_server \
2 --model-path ai-sage/GigaChat3.1-10B-A1.8B \
3 --host 0.0.0.0 \
4 --port 30000 \
5 --dtype auto \
6 --mem-fraction-static 0.88 \
7 --speculative-algorithm EAGLE \
8 --speculative-num-steps 1 \
9 --speculative-eagle-topk 1 \
10 --speculative-num-draft-tokens 2
Request example
1curl http://localhost:30000/v1/chat/completions \
2 -H "Content-Type: application/json" \
3 -d '{
4 "model": "ai-sage/GigaChat3.1-10B-A1.8B",
5 "messages": [
6 {
7 "role": "user",
8 "content": "Докажи теорему о неподвижной точке"
9 }
10 ],
11 "max_tokens": 1000,
12 "temperature": 0
13 }'
Function calling
1. transformers
Click for a dropdown
1import torch
2import json
3from transformers import AutoTokenizer, AutoModelForCausalLM, GenerationConfig
4
5FUNCTION_CALL_TOKEN = "<|function_call|>"
6
7def parse_function_and_content(completion_str: str):
8 completion_str = completion_str.strip()
9
10 if FUNCTION_CALL_TOKEN not in completion_str:
11 return None, completion_str or None
12
13 content_part, function_part = completion_str.split(FUNCTION_CALL_TOKEN, 1)
14
15 content = content_part.strip() or None
16 function_part = function_part.strip()
17
18 for suffix in ("</s>", "<s>"):
19 if function_part.endswith(suffix):
20 function_part = function_part[: -len(suffix)].strip()
21
22 try:
23 function_call = json.loads(function_part)
24 except json.JSONDecodeError:
25 return None, content if content is not None else completion_str
26
27 if not (
28 isinstance(function_call, dict)
29 and "name" in function_call
30 and "arguments" in function_call
31 and isinstance(function_call["arguments"], dict)
32 ):
33 return None, content
34
35 return function_call, content
36
37
38model_name = "ai-sage/GigaChat3.1-10B-A1.8B"
39
40tokenizer = AutoTokenizer.from_pretrained(model_name)
41model = AutoModelForCausalLM.from_pretrained(
42 model_name,
43 torch_dtype=torch.bfloat16,
44 device_map="auto",
45)
46model.generation_config = GenerationConfig.from_pretrained(model_name)
47
48tools = [
49 {
50 "type": "function",
51 "function": {
52 "name": "get_weather",
53 "description": "Получить информацию о текущей погоде в указанном городе.",
54 "parameters": {
55 "type": "object",
56 "properties": {
57 "city": {
58 "type": "string",
59 "description": "Название города (например, Москва, Казань)."
60 }
61 },
62 "required": ["city"]
63 }
64 }
65 }
66]
67
68messages = [
69 {"role": "user", "content": "Какая сейчас погода в Москве?"}
70]
71
72prompt = tokenizer.apply_chat_template(
73 messages,
74 tools=tools,
75 tokenize=False,
76 add_generation_prompt=True,
77)
78
79inputs = tokenizer(prompt, return_tensors="pt")
80inputs = {k: v.to(model.device) for k, v in inputs.items()}
81
82with torch.inference_mode():
83 outputs = model.generate(
84 **inputs,
85 max_new_tokens=1000,
86 )
87
88prompt_len = inputs["input_ids"].shape[1]
89completion = tokenizer.decode(
90 outputs[0][prompt_len:],
91 skip_special_tokens=False,
92)
93
94function_call, content = parse_function_and_content(completion)
95print(function_call, content)
2. vLLM
Start the server
1vllm serve ai-sage/GigaChat3.1-10B-A1.8B \
2 --dtype "auto" \
3 --speculative-config '{"method": "mtp", "num_speculative_tokens": 1, "disable_padded_drafter_batch": false}' \
4 --enable-auto-tool-choice \
5 --tool-call-parser gigachat3
Request example
1curl http://localhost:8000/v1/chat/completions \
2 -H "Content-Type: application/json" \
3 -d '{
4 "model": "ai-sage/GigaChat3.1-10B-A1.8B",
5 "temperature": 0,
6 "messages": [
7 {
8 "role": "user",
9 "content": "Какая сейчас погода в Москве?"
10 }
11 ],
12 "tools": [
13 {
14 "type": "function",
15 "function": {
16 "name": "get_weather",
17 "description": "Получить информацию о текущей погоде в указанном городе.",
18 "parameters": {
19 "type": "object",
20 "properties": {
21 "city": {
22 "type": "string",
23 "description": "Название города (например, Москва, Казань)."
24 }
25 },
26 "required": ["city"]
27 }
28 }
29 }
30 ]
31}'
3. SGLang
Start the server
1python -m sglang.launch_server \
2 --model-path ai-sage/GigaChat3.1-10B-A1.8B \
3 --host 0.0.0.0 \
4 --port 30000 \
5 --dtype auto \
6 --mem-fraction-static 0.88 \
7 --speculative-algorithm EAGLE \
8 --speculative-num-steps 1 \
9 --speculative-eagle-topk 1 \
10 --speculative-num-draft-tokens 2
11 --tool-call-parser gigachat3
Request example
1curl http://localhost:30000/v1/chat/completions \
2 -H "Content-Type: application/json" \
3 -d '{
4 "model": "ai-sage/GigaChat3.1-10B-A1.8B",
5 "temperature": 0,
6 "messages": [
7 {
8 "role": "user",
9 "content": "Какая сейчас погода в Москве?"
10 }
11 ],
12 "tools": [
13 {
14 "type": "function",
15 "function": {
16 "name": "get_weather",
17 "description": "Получить информацию о текущей погоде в указанном городе.",
18 "parameters": {
19 "type": "object",
20 "properties": {
21 "city": {
22 "type": "string",
23 "description": "Название города (например, Москва, Казань)."
24 }
25 },
26 "required": ["city"]
27 }
28 }
29 }
30 ]
31}'