Views
No views yet
'none' → Do not use reasoning'high' → Use reasoning (recommended for complex prompts)
Use reasoning_effort="high" for complex tasksLeanstral 119B A6B with Mistral Vibe. Install the latest version (2.5.0):1uv pip install mistral-vibe --upgrade
2
3# make sure it's >= 2.5.0vibe and simply running:/leanstallleanstral as an additional model, add a system prompt (see LEAD.md) as well as
ensure leanstral can be used as a subagent.
leanstral model.
Usage - vllmlean.toml in ~/.vibe/agents:mkdir ~/.vibe/agents/ && touch ~/.vibe/agents/lean.toml~/.vibe/agents/lean.toml1display_name = "Lean (local vLLM)"
2description = "Lean 4 mode using local vLLM"
3safety = "neutral"
4
5system_prompt_id = "lean"
6active_model = "leanstral"
7
8[[providers]]
9name = "vllm"
10api_base = "http://<your-host-url>:8000/v1"
11api_key_env_var = ""
12backend = "generic"
13reasoning_field_name = "reasoning_content"
14
15[[models]]
16name = "mistralai/Leanstral-2603"
17provider = "vllm"
18alias = "leanstral"
19thinking = "high"
20temperature = 1.0
21auto_compact_threshold = 168000
22
23[tools.bash]
24default_timeout = 1200<your-host-url> with your server's url.vibe and "tab-shift" to "lean" mode.vllm (recommended): See here.transformers: WIP ⏳ - follow updates on this PR.SGLang: WIP ⏳ - follow updates on this PR[!Tip] We recommend installing vLLM from our custom Docker image that has fixes for Tool Calling and Reasoning parsing in vLLM and uses the latest version of Transformers. We're working with the vLLM team to merge these fixes to main as soon as possible.
docker pull mistralllm/vllm-ms4:latest
docker run -it mistralllm/vllm-ms4:latestvllm from this PR: Add Mistral Guidance.vllm main in the coming 1-2 weeks (Stand: 16.03.2026).
Check latest developments directly on the PR.git clone --branch fix_mistral_parsing https://github.com/juliendenize/vllm.gitVLLM_USE_PRECOMPILED=1 pip install --editable .transformers is installed from "main":uv pip install git+https://github.com/huggingface/transformers.gitmistral_common >= 1.10.0.
To check:python -c "import mistral_common; print(mistral_common.__version__)"vllm serve mistralai/Leanstral-2603 \
--max-model-len 200000 \
--tensor-parallel-size 4 \
--attention-backend FLASH_ATTN_MLA \
--tool-call-parser mistral \
--enable-auto-tool-choice \
--reasoning-parser mistral1from openai import OpenAI
2from huggingface_hub import hf_hub_download
3
4# Modify OpenAI's API key and API base to use vLLM's API server.
5openai_api_key = "EMPTY"
6openai_api_base = "<your-host-url>"
7
8client = OpenAI(
9 api_key=openai_api_key,
10 base_url=openai_api_base,
11)
12
13TEMP = 1.0
14MAX_TOK = 32000
15REASONING = "high" # switch to 'none' for faster answers
16
17models = client.models.list()
18model = models.data[0].id
19
20
21prompt = """Define the transition rules as an inductive proposition.
22
23This choice provides better support for proving properties about valid transitions and is generally more natural for modeling state machines in Lean, where you want to express logical rules rather than just computing a yes/no vale for each possible transition."""
24messages = [
25 {
26 "role": "user",
27 "content": [
28 {
29 "type": "text",
30 "text": prompt,
31 },
32 ],
33 },
34]
35
36
37
38response = client.chat.completions.create(
39 model=model,
40 messages=messages,
41 temperature=TEMP,
42 max_tokens=MAX_TOK,
43 reasoning_effort=REASONING,
44)
45
46print("Content")
47print(response.choices[0].message.content)
48
49pritn("Reasoning")
50print(response.choices[0].message.reasoning)1-- Example: Counter that can only increment by 1 (no decrement, no shortcuts)
2inductive ValidTransition : Nat → Nat → Prop
3 | step1 : ∀ s, ValidTransition s (s + 1) -- Core transition: s → s+1
4 | step2 : ∀ s, ValidTransition s (2 * s) -- Bonus: s → 2s (optional)
5 | zero_step : ValidTransition 0 0 -- Additional special case
6
7lemma reach_any_positive : ∀ n > 0, ValidTransition 0 n := by
8 induction n with
9 | zero => contradiction
10 | succ n ih =>
11 cases' Nat.eq_zero_or_pos n with h h
12 · simp [h]
13 · have : ValidTransition 0 (n + 1) := by
14 cases' h with _ ih -- Wait, this is messy...ValidTransition is defined as an inductive proposition with constructors step1, step2, and zero_step. The step1 constructor allows for any state to transition to the next state by incrementing by 1, while step2 allows for doubling the state. The zero_step constructor is a special case for the initial state 0.reach_any_positive aims to prove that any positive natural number is reachable from the initial state 0 through valid transitions. The proof uses induction on n, but due to simplification issues, the current approach may not be the most effective.1-- Simpler model for counter transitions (suffices for proofs)
2inductive CounterTrans : Nat → Nat → Prop
3 | valid : ∀ n, CounterTrans n (n + 1)
4
5lemma reach_positive : ∀ n > 0, CounterTrans 0 n
6 -- Proof is now trivial (by induction)CounterTrans is defined with a single constructor valid, which allows for any state to transition to the next state by incrementing by 1. The lemma reach_positive is straightforward to prove by induction, leveraging the simplicity of the transition rules.tools to the chat completion as follows:1prompt = """I have the following Lean 4 code snippet and want to check if it compiles and runs without errors. Can you run it for me and let me know the result?
2
3```lean\ninductive State where\n | idle\n | busy\n | error\n\ndef transition : State → State → Bool\n | .idle, .busy => true\n | .busy, .idle => true\n | .busy, .error => true\n | _, _ => false\n\n#eval transition .idle .busy\n```"""
4
5tools = [{
6 "type": "function",
7 "function": {
8 "name": "lean_run_code",
9 "description": "Run or compile an independent Lean code snippet or file and return the result or error message.",
10 "parameters": {
11 "type": "object",
12 "properties": {
13 "code": {
14 "type": "string",
15 "description": "Lean code snippet to run or compile. Either this or file_path must be provided."
16 },
17 "file_path": {
18 "type": "string",
19 "description": "Path to the Lean file to run or compile. Either this or code must be provided."
20 }
21 },
22 }
23 }
24}]
25
26messages = [
27 {
28 "role": "user",
29 "content": [
30 {
31 "type": "text",
32 "text": prompt,
33 },
34 ],
35 },
36]
37
38response = client.chat.completions.create(
39 model=model,
40 messages=messages,
41 temperature=TEMP,
42 max_tokens=MAX_TOK,
43 reasoning_effort=REASONING,
44 tools=tools,
45)
46
47print("Tool Calls")
48print(response.choices[0].message.tool_calls)
49
50print("Reasoning")
51print(response.choices[0].message.reasoning)Function(arguments='{"code": "inductive State where\\n | idle\\n | busy\\n | error\\n\\ndef transition : State → State → Bool\\n | .idle, .busy => true\\n | .busy, .idle => true\\n | .busy, .error => true\\n | _, _ => false\\n\\n#eval transition .idle .busy"}', name='lean_run_code')