Instructions to use jackcloudman/Leanstral-2603-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use jackcloudman/Leanstral-2603-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="jackcloudman/Leanstral-2603-GGUF", filename="mistralai_Leanstral-128x3.9B-2603-Q4_K_M.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use jackcloudman/Leanstral-2603-GGUF with llama.cpp:
Install from brew
brew install llama.cpp # 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
Install from WinGet (Windows)
winget install llama.cpp # 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
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 Studio new
How to use jackcloudman/Leanstral-2603-GGUF with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for jackcloudman/Leanstral-2603-GGUF to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for jackcloudman/Leanstral-2603-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for jackcloudman/Leanstral-2603-GGUF to start chatting
- 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
output = llm(
"Once upon a time,",
max_tokens=512,
echo=True
)
print(output)Leanstral 119B A6B - GGUF
GGUF quantizations of mistralai/Leanstral-2603 for use with llama.cpp.
Leanstral is the first open-source code agent designed for Lean 4, 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.
Available Quantizations
| File | Quant | Size | Description |
|---|---|---|---|
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 |
mistralai_Leanstral-128x3.9B-2603-Q8_0.gguf |
Q8_0 | 118 GB | Near-lossless. Good base for custom requantization |
Architecture
- Type: Mixture of Experts (MoE) + Multi-head Latent Attention (MLA)
- GGUF arch:
deepseek2(Mistral 4 uses the same architecture as DeepSeek V3) - Total parameters: 119B (6.5B active per token)
- Experts: 128 routed + 1 shared, 4 active per token
- MLA: q_lora_rank=1024, kv_lora_rank=256, qk_rope_head_dim=64
- Context: Up to 1M tokens (256k recommended)
- RoPE: YaRN scaling (factor=128, original_ctx=8192)
- Vocab: 131,072 tokens (Tekken tokenizer)
How to Run
llama-server (recommended)
./llama-server \
-m mistralai_Leanstral-128x3.9B-2603-Q4_K_M.gguf \
-fit on -fa on \
--host 0.0.0.0 \
--ctx-size 128000 \
--jinja \
--chat-template-file chat_template.jinja
Note: You need a chat template that supports
[THINK]blocks for reasoning. Download the template from the original model repo.
Reasoning
The model supports reasoning_effort via the chat template:
"high"- Enables thinking (recommended for Lean 4 proofs and complex tasks)"none"- Direct answers without reasoning
Pass reasoning_effort in your API request body, or modify the chat template default.
Performance
On 2x RTX 4090 (48GB VRAM) + 192GB RAM with Q4_K_M:
- ~34 tokens/s generation speed
- Model splits between GPU and system RAM automatically with
-fit on
Conversion Details
- Source: FP8 (e4m3) consolidated weights from mistralai/Leanstral-2603
- Pipeline: FP8 consolidated โ dequant to BF16 โ Q8_0 GGUF โ Q4_K_M GGUF (with
--allow-requantize) - Converter:
convert_hf_to_gguf.pywith--mistral-formatflag (llama.cpp) - Tokenizer: Tekken v15 (requires
mistral-common >= 1.10.0for conversion)
License
Apache 2.0 - same as the original model.
Credits
- Original model by Mistral AI
- Quantized by jackcloudman
- Downloads last month
- 428
4-bit
8-bit
Model tree for jackcloudman/Leanstral-2603-GGUF
Base model
mistralai/Leanstral-2603
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="jackcloudman/Leanstral-2603-GGUF", filename="", )