Instructions to use RockTalk/GigaChat3.1-702B-A36B-MLX-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use RockTalk/GigaChat3.1-702B-A36B-MLX-4bit with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("RockTalk/GigaChat3.1-702B-A36B-MLX-4bit") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- LM Studio
- Pi new
How to use RockTalk/GigaChat3.1-702B-A36B-MLX-4bit with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "RockTalk/GigaChat3.1-702B-A36B-MLX-4bit"
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "RockTalk/GigaChat3.1-702B-A36B-MLX-4bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use RockTalk/GigaChat3.1-702B-A36B-MLX-4bit with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "RockTalk/GigaChat3.1-702B-A36B-MLX-4bit"
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default RockTalk/GigaChat3.1-702B-A36B-MLX-4bit
Run Hermes
hermes
- MLX LM
How to use RockTalk/GigaChat3.1-702B-A36B-MLX-4bit with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "RockTalk/GigaChat3.1-702B-A36B-MLX-4bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "RockTalk/GigaChat3.1-702B-A36B-MLX-4bit" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "RockTalk/GigaChat3.1-702B-A36B-MLX-4bit", "messages": [ {"role": "user", "content": "Hello"} ] }'
GigaChat3.1-702B-A36B — MLX 4-bit
MLX 4-bit quantization of ai-sage/GigaChat3.1-702B-A36B-bf16 for Apple Silicon.
Model Details
- Architecture: DeepseekV3 MoE + MLA (Multi-head Latent Attention)
- Total Parameters: 702B
- Active Parameters: 36B (8 of 256 experts per token)
- Quantization: 4-bit (group size 64, 4.502 bits/weight avg)
- Model Size: 368 GB
- Context: 262K tokens
- License: MIT (same as original)
- Converted by: RockTalk using mlx_lm v0.31.1
Requirements
- Apple Silicon Mac with 384GB+ unified memory (512GB recommended)
- macOS 14+
- mlx_lm >= 0.31.0
Performance (M3 Ultra, 512GB)
| Metric | Value |
|---|---|
| Load time | ~18 min |
| Generation speed | ~12 tok/s |
| RAM usage | ~368 GB |
Usage
from mlx_lm import load, generate
from mlx_lm.sample_utils import make_sampler
model, tokenizer = load("RockTalk/GigaChat3.1-702B-A36B-MLX-4bit")
sampler = make_sampler(temp=0.7)
messages = [{"role": "user", "content": "Hello!"}]
prompt = tokenizer.apply_chat_template(messages, add_generation_prompt=True, tokenize=False)
response = generate(model, tokenizer, prompt=prompt, max_tokens=500, sampler=sampler)
print(response)
Conversion Notes
Converted from bf16 source weights. The conversion required patching mlx_lm's deepseek_v3.py sanitize method — it hardcodes MTP (Multi-Token Prediction) layer removal at layer index 61 (correct for DeepSeek-V3's 61 transformer layers), but GigaChat has 64 transformer layers so the MTP head is at layer 64. The fix:
# In mlx_lm/models/deepseek_v3.py, sanitize() method:
# Change hardcoded "model.layers.61" to dynamic:
mtp_prefix = f"model.layers.{self.args.num_hidden_layers}"
The tokenizer_class was also patched from TokenizersBackend (transformers v5) to PreTrainedTokenizerFast.
About GigaChat
GigaChat is Sber's (Russia's largest bank) AI model family. The 702B "Ultra" is their flagship — same DeepseekV3 architecture (MoE + MLA + MTP) trained on multilingual data (~5.5T synthetic tokens, 10 languages). MIT licensed.
- Downloads last month
- 52
4-bit
Model tree for RockTalk/GigaChat3.1-702B-A36B-MLX-4bit
Base model
ai-sage/GigaChat3.1-702B-A36B-bf16