Instructions to use jackcloudman/Leanstral-2603-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use jackcloudman/Leanstral-2603-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf jackcloudman/Leanstral-2603-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf jackcloudman/Leanstral-2603-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf jackcloudman/Leanstral-2603-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf jackcloudman/Leanstral-2603-GGUF:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf jackcloudman/Leanstral-2603-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf jackcloudman/Leanstral-2603-GGUF:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf jackcloudman/Leanstral-2603-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf jackcloudman/Leanstral-2603-GGUF:Q4_K_M
Use Docker
docker model run hf.co/jackcloudman/Leanstral-2603-GGUF:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use jackcloudman/Leanstral-2603-GGUF with Ollama:
ollama run hf.co/jackcloudman/Leanstral-2603-GGUF:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use jackcloudman/Leanstral-2603-GGUF with Docker Model Runner:
docker model run hf.co/jackcloudman/Leanstral-2603-GGUF:Q4_K_M
- Lemonade
How to use jackcloudman/Leanstral-2603-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull jackcloudman/Leanstral-2603-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.Leanstral-2603-GGUF-Q4_K_M
List all available models
lemonade list
- Atomic Chat
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model: mistralai/Leanstral-2603
|
| 4 |
+
tags:
|
| 5 |
+
- gguf
|
| 6 |
+
- llama-cpp
|
| 7 |
+
- mistral
|
| 8 |
+
- moe
|
| 9 |
+
- lean4
|
| 10 |
+
- math
|
| 11 |
+
- deepseek2
|
| 12 |
+
quantized_by: jackcloudman
|
| 13 |
+
model_type: deepseek2
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
# Leanstral 119B A6B - GGUF
|
| 17 |
+
|
| 18 |
+
GGUF quantizations of [mistralai/Leanstral-2603](https://huggingface.co/mistralai/Leanstral-2603) for use with [llama.cpp](https://github.com/ggml-org/llama.cpp).
|
| 19 |
+
|
| 20 |
+
Leanstral is the first open-source code agent designed for [Lean 4](https://github.com/leanprover/lean4), a proof assistant for formal mathematics and software verification. Built as part of the Mistral Small 4 family, it combines multimodal capabilities with an efficient MoE + MLA architecture.
|
| 21 |
+
|
| 22 |
+
## Available Quantizations
|
| 23 |
+
|
| 24 |
+
| File | Quant | Size | Description |
|
| 25 |
+
|------|-------|------|-------------|
|
| 26 |
+
| `mistralai_Leanstral-128x3.9B-2603-Q4_K_M.gguf` | Q4_K_M | 68 GB | Best balance of quality and size. Runs on 2x RTX 4090 + RAM offload |
|
| 27 |
+
| `mistralai_Leanstral-128x3.9B-2603-Q8_0.gguf` | Q8_0 | 118 GB | Near-lossless. Good base for custom requantization |
|
| 28 |
+
|
| 29 |
+
## Architecture
|
| 30 |
+
|
| 31 |
+
- **Type**: Mixture of Experts (MoE) + Multi-head Latent Attention (MLA)
|
| 32 |
+
- **GGUF arch**: `deepseek2` (Mistral 4 uses the same architecture as DeepSeek V3)
|
| 33 |
+
- **Total parameters**: 119B (6.5B active per token)
|
| 34 |
+
- **Experts**: 128 routed + 1 shared, 4 active per token
|
| 35 |
+
- **MLA**: q_lora_rank=1024, kv_lora_rank=256, qk_rope_head_dim=64
|
| 36 |
+
- **Context**: Up to 1M tokens (256k recommended)
|
| 37 |
+
- **RoPE**: YaRN scaling (factor=128, original_ctx=8192)
|
| 38 |
+
- **Vocab**: 131,072 tokens (Tekken tokenizer)
|
| 39 |
+
|
| 40 |
+
## How to Run
|
| 41 |
+
|
| 42 |
+
### llama-server (recommended)
|
| 43 |
+
|
| 44 |
+
```bash
|
| 45 |
+
./llama-server \
|
| 46 |
+
-m mistralai_Leanstral-128x3.9B-2603-Q4_K_M.gguf \
|
| 47 |
+
-fit on -fa on \
|
| 48 |
+
--host 0.0.0.0 \
|
| 49 |
+
--ctx-size 128000 \
|
| 50 |
+
--jinja \
|
| 51 |
+
--chat-template-file chat_template.jinja
|
| 52 |
+
```
|
| 53 |
+
|
| 54 |
+
> **Note**: You need a chat template that supports `[THINK]` blocks for reasoning. Download the template from the [original model repo](https://huggingface.co/mistralai/Leanstral-2603).
|
| 55 |
+
|
| 56 |
+
### Reasoning
|
| 57 |
+
|
| 58 |
+
The model supports `reasoning_effort` via the chat template:
|
| 59 |
+
- `"high"` - Enables thinking (recommended for Lean 4 proofs and complex tasks)
|
| 60 |
+
- `"none"` - Direct answers without reasoning
|
| 61 |
+
|
| 62 |
+
Pass `reasoning_effort` in your API request body, or modify the chat template default.
|
| 63 |
+
|
| 64 |
+
### Performance
|
| 65 |
+
|
| 66 |
+
On 2x RTX 4090 (48GB VRAM) + 192GB RAM with Q4_K_M:
|
| 67 |
+
- ~34 tokens/s generation speed
|
| 68 |
+
- Model splits between GPU and system RAM automatically with `-fit on`
|
| 69 |
+
|
| 70 |
+
## Conversion Details
|
| 71 |
+
|
| 72 |
+
- **Source**: FP8 (e4m3) consolidated weights from [mistralai/Leanstral-2603](https://huggingface.co/mistralai/Leanstral-2603)
|
| 73 |
+
- **Pipeline**: FP8 consolidated → dequant to BF16 → Q8_0 GGUF → Q4_K_M GGUF (with `--allow-requantize`)
|
| 74 |
+
- **Converter**: `convert_hf_to_gguf.py` with `--mistral-format` flag (llama.cpp)
|
| 75 |
+
- **Tokenizer**: Tekken v15 (requires `mistral-common >= 1.10.0` for conversion)
|
| 76 |
+
|
| 77 |
+
## License
|
| 78 |
+
|
| 79 |
+
Apache 2.0 - same as the original model.
|
| 80 |
+
|
| 81 |
+
## Credits
|
| 82 |
+
|
| 83 |
+
- Original model by [Mistral AI](https://huggingface.co/mistralai)
|
| 84 |
+
- Quantized by [jackcloudman](https://huggingface.co/jackcloudman)
|