Instructions to use SharpAir/Levante with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use SharpAir/Levante with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle

Levante
Levante is a mixture-of-experts style assistant built on Ministral 3 8B Instruct. A lightweight router reads each request and hands it to one of three small LoRA experts that share the same base model:
| Expert | Folder | Good at |
|---|---|---|
| Tools | tools/ |
Calling functions, and knowing when not to call one. Default for chat and agent steps |
| Coding | coding/ |
Writing code that passes its tests |
| Math | math/ |
Word problems, step by step, ending in a final answer |
Each expert is a QLoRA adapter of about 90 MB, so one copy of the base model serves all three. Levante is an independent student project by Extra, trained entirely on free Kaggle T4 GPUs, and it is still in development. It is not affiliated with Mistral AI.
Results
Correct answers on 200 held-out prompts per expert, against the base model on the same prompts (greedy decoding, base model in 4-bit).
| Expert | Ministral 3 8B | Levante expert |
|---|---|---|
| Tools | 129 / 200 | 152 / 200 |
| Coding | 163 / 200 | 168 / 200 |
| Math | 184 / 200 | 188 / 200 |
- Tools: 200 prompts from Glaive, Hermes function calling and When2Call, none seen in training. A pass is the exact function call (name and arguments), or correctly answering without a call. This is a clear gain over the base model, mostly from knowing when not to call a tool.
- Coding: 100 MBPP (sanitized test split) and 100 HumanEval problems, scored by running their unit tests.
- Math: 200 GSM8K test problems, scored on the exact final number.
The coding and math gains are small, within what 200 prompts can tell apart, so read them as "keeps the base model's strength" rather than a big jump.
Use it
With Transformers and PEFT
from transformers import AutoModelForImageTextToText, AutoTokenizer
from peft import PeftModel
base_id = "unsloth/Ministral-3-8B-Instruct-2512-unsloth-bnb-4bit" # 4-bit, fits a 16 GB GPU
tok = AutoTokenizer.from_pretrained("mistralai/Ministral-3-8B-Instruct-2512")
base = AutoModelForImageTextToText.from_pretrained(base_id, device_map="auto")
model = PeftModel.from_pretrained(base, "SharpAir/Levante", subfolder="math", adapter_name="math")
model.load_adapter("SharpAir/Levante", subfolder="coding", adapter_name="coding")
model.load_adapter("SharpAir/Levante", subfolder="tools", adapter_name="tools")
model.set_adapter("math")
messages = [
{"role": "system", "content": "You are Levante, a helpful assistant that is very good at math. "
"Solve problems step by step and end with the final answer."},
{"role": "user", "content": "A shirt costs 25 dollars and is 20% off. How much do I pay?"},
]
inputs = tok.apply_chat_template(messages, add_generation_prompt=True,
return_tensors="pt", return_dict=True).to(model.device)
out = model.generate(**inputs, max_new_tokens=512, do_sample=False)
print(tok.decode(out[0, inputs["input_ids"].shape[-1]:], skip_special_tokens=True))
Each expert was trained with its own system prompt. Use the same one for best results; all three are in
router/router.json.
The router
router/levante_router.py picks the expert for a message with no extra model and no dependencies:
from levante_router import Router
r = Router.load("router/router.json")
expert = r.route("Why does my Python loop never end?") # -> "coding"
system_prompt = r.system_prompt(expert)
Messages that are clearly about code go to coding, clearly about math go to math, and everything else
goes to tools, which is also the best expert for general chat and agent steps.
Training
- Base: Ministral 3 8B Instruct (2512), trained on Unsloth's 4-bit copy of it.
- Method: QLoRA, rank 16, alpha 16, no dropout, on the attention and MLP layers of the language model (the vision encoder is untouched). Up to 4,096 tokens per example, 1 epoch, learning rate 2e-4 with cosine decay, 8-bit AdamW. Loss only on the assistant's own words.
- Tools: about 1,500 conversations from Glaive function calling v2, Hermes function calling v1 and When2Call, including chats where the right answer is not to call a tool.
- Coding: 509 problems from MBPP (train, validation and prompt splits) and OpenCodeInstruct, each answered by the base model itself and kept only if the answer passed the problem's unit tests.
- Math: 952 GSM8K training problems, each solved step by step by the base model itself and kept only if the final answer matched the reference.
- Hardware: free Kaggle T4 GPUs.
None of the test prompts above appear in the training data.
Limits
- The base model is multimodal, but the experts were trained and tested on text only.
- Trained with up to 4,096 tokens per example; long conversations past that are untested.
- Coding answers sometimes run long and get cut off at the token limit; give them room
(
max_new_tokensof 1,024 or more). - Like any small model, Levante can be confidently wrong. Check code and numbers that matter.
License and credits
The adapters and router are released under the Apache 2.0 license, the same as the base model. Training used these datasets, under their own licenses:
- Glaive function calling v2 (ShareGPT format), Apache 2.0
- Hermes function calling v1, Apache 2.0
- When2Call, CC BY 4.0
- MBPP, CC BY 4.0
- OpenCodeInstruct, CC BY 4.0
- GSM8K, MIT
HumanEval (MIT) was used for testing only. Built on Ministral 3 8B Instruct by Mistral AI.
- Downloads last month
- -
Model tree for SharpAir/Levante
Base model
mistralai/Ministral-3-8B-Base-2512