Views
No views yet
Mistral-Small-3.1 the vision encoder was removed.| Model | Scaffold | SWE-Bench Verified (%) |
|---|---|---|
| Devstral | OpenHands Scaffold | 46.8 |
| GPT-4.1-mini | OpenAI Scaffold | 23.6 |
| Claude 3.5 Haiku | Anthropic Scaffold | 40.6 |
| SWE-smith-LM 32B | SWE-agent Scaffold | 40.2 |

1export MISTRAL_API_KEY=<MY_KEY>
2
3docker pull docker.all-hands.dev/all-hands-ai/runtime:0.39-nikolaik
4
5mkdir -p ~/.openhands-state && echo '{"language":"en","agent":"CodeActAgent","max_iterations":null,"security_analyzer":null,"confirmation_mode":false,"llm_model":"mistral/devstral-small-2505","llm_api_key":"'$MISTRAL_API_KEY'","remote_runtime_resource_factor":null,"github_token":null,"enable_default_condenser":true}' > ~/.openhands-state/settings.json
6
7docker run -it --rm --pull=always \
8 -e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.39-nikolaik \
9 -e LOG_ALL_EVENTS=true \
10 -v /var/run/docker.sock:/var/run/docker.sock \
11 -v ~/.openhands-state:/.openhands-state \
12 -p 3000:3000 \
13 --add-host host.docker.internal:host-gateway \
14 --name openhands-app \
15 docker.all-hands.dev/all-hands-ai/openhands:0.39vllm (recommended): See heremistral-inference: See heretransformers: See hereLMStudio: See hereollama: See hereDevstral-Small-2505.vllm serve mistralai/Devstral-Small-2505 --tokenizer_mode mistral --config_format mistral --load_format mistral --tool-call-parser mistral --enable-auto-tool-choice --tensor-parallel-size 2http://<your-server-url>:8000/v11docker pull docker.all-hands.dev/all-hands-ai/runtime:0.38-nikolaik
2
3docker run -it --rm --pull=always \
4 -e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.38-nikolaik \
5 -e LOG_ALL_EVENTS=true \
6 -v /var/run/docker.sock:/var/run/docker.sock \
7 -v ~/.openhands-state:/.openhands-state \
8 -p 3000:3000 \
9 --add-host host.docker.internal:host-gateway \
10 --name openhands-app \
11 docker.all-hands.dev/all-hands-ai/openhands:0.38http://localhost:3000.openai/mistralai/Devstral-Small-2505http://<your-server-url>:8000/v1token (or any other token you used to launch the server if any)1Build a To-Do list app with the following requirements:
2- Built using FastAPI and React.
3- Make it a one page app that:
4 - Allows to add a task.
5 - Allows to delete a task.
6 - Allows to mark a task as done.
7 - Displays the list of tasks.
8- Store the tasks in a SQLite database.


vLLM >= 0.8.5:pip install vllm --upgrademistral_common >= 1.5.5.python -c "import mistral_common; print(mistral_common.__version__)"vllm serve mistralai/Devstral-Small-2505 --tokenizer_mode mistral --config_format mistral --load_format mistral --tool-call-parser mistral --enable-auto-tool-choice --tensor-parallel-size 21import requests
2import json
3from huggingface_hub import hf_hub_download
4
5
6url = "http://<your-server-url>:8000/v1/chat/completions"
7headers = {"Content-Type": "application/json", "Authorization": "Bearer token"}
8
9model = "mistralai/Devstral-Small-2505"
10
11def load_system_prompt(repo_id: str, filename: str) -> str:
12 file_path = hf_hub_download(repo_id=repo_id, filename=filename)
13 with open(file_path, "r") as file:
14 system_prompt = file.read()
15 return system_prompt
16
17SYSTEM_PROMPT = load_system_prompt(model, "SYSTEM_PROMPT.txt")
18
19messages = [
20 {"role": "system", "content": SYSTEM_PROMPT},
21 {
22 "role": "user",
23 "content": [
24 {
25 "type": "text",
26 "text": "<your-command>",
27 },
28 ],
29 },
30]
31
32data = {"model": model, "messages": messages, "temperature": 0.15}
33
34response = requests.post(url, headers=headers, data=json.dumps(data))
35print(response.json()["choices"][0]["message"]["content"])pip install mistral_inference --upgrade1from huggingface_hub import snapshot_download
2from pathlib import Path
3
4mistral_models_path = Path.home().joinpath('mistral_models', 'Devstral')
5mistral_models_path.mkdir(parents=True, exist_ok=True)
6
7snapshot_download(repo_id="mistralai/Devstral-Small-2505", allow_patterns=["params.json", "consolidated.safetensors", "tekken.json"], local_dir=mistral_models_path)mistral-chat $HOME/mistral_models/Devstral --instruct --max_tokens 300 mistral-common >= 1.5.5 to use our tokenizer.pip install mistral-common --upgrade1import torch
2
3from mistral_common.protocol.instruct.messages import (
4 SystemMessage, UserMessage
5)
6from mistral_common.protocol.instruct.request import ChatCompletionRequest
7from mistral_common.tokens.tokenizers.mistral import MistralTokenizer
8from mistral_common.tokens.tokenizers.tekken import SpecialTokenPolicy
9from huggingface_hub import hf_hub_download
10from transformers import AutoModelForCausalLM
11
12def load_system_prompt(repo_id: str, filename: str) -> str:
13 file_path = hf_hub_download(repo_id=repo_id, filename=filename)
14 with open(file_path, "r") as file:
15 system_prompt = file.read()
16 return system_prompt
17
18model_id = "mistralai/Devstral-Small-2505"
19tekken_file = hf_hub_download(repo_id=model_id, filename="tekken.json")
20SYSTEM_PROMPT = load_system_prompt(model_id, "SYSTEM_PROMPT.txt")
21
22tokenizer = MistralTokenizer.from_file(tekken_file)
23
24model = AutoModelForCausalLM.from_pretrained(model_id)
25
26tokenized = tokenizer.encode_chat_completion(
27 ChatCompletionRequest(
28 messages=[
29 SystemMessage(content=SYSTEM_PROMPT),
30 UserMessage(content="<your-command>"),
31 ],
32 )
33)
34
35output = model.generate(
36 input_ids=torch.tensor([tokenized.tokens]),
37 max_new_tokens=1000,
38)[0]
39
40decoded_output = tokenizer.decode(output[len(tokenized.tokens):])
41print(decoded_output)pip install -U "huggingface_hub[cli]"
huggingface-cli download \
"mistralai/Devstral-Small-2505_gguf" \
--include "devstralQ4_K_M.gguf" \
--local-dir "mistralai/Devstral-Small-2505_gguf/"lms cli ~/.lmstudio/bin/lms bootstraplms import devstralQ4_K_M.gguf in the directory where you've downloaded the model checkpoint (e.g. mistralai/Devstral-Small-2505_gguf)1docker pull docker.all-hands.dev/all-hands-ai/runtime:0.38-nikolaik
2docker run -it --rm --pull=always \
3 -e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.38-nikolaik \
4 -e LOG_ALL_EVENTS=true \
5 -v /var/run/docker.sock:/var/run/docker.sock \
6 -v ~/.openhands-state:/.openhands-state \
7 -p 3000:3000 \
8 --add-host host.docker.internal:host-gateway \
9 --name openhands-app \
10 docker.all-hands.dev/all-hands-ai/openhands:0.38ollama run devstral