Views
No views yet
Mistral-Small-3.1 the vision encoder was removed.Devstral Small 1.0:Devstral Small 1.1 is still great when paired with OpenHands. This new version also generalizes better to other prompts and coding environments.| Model | Agentic Scaffold | SWE-Bench Verified (%) |
|---|---|---|
| Devstral Small 1.1 | OpenHands Scaffold | 53.6 |
| Devstral Small 1.0 | 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 |
| Skywork SWE | OpenHands Scaffold | 38.0 |
| DeepSWE | R2E-Gym Scaffold | 42.2 |

1export MISTRAL_API_KEY=<MY_KEY>
2
3mkdir -p ~/.openhands && echo '{"language":"en","agent":"CodeActAgent","max_iterations":null,"security_analyzer":null,"confirmation_mode":false,"llm_model":"mistral/devstral-small-2507","llm_api_key":"'$MISTRAL_API_KEY'","remote_runtime_resource_factor":null,"github_token":null,"enable_default_condenser":true}' > ~/.openhands-state/settings.json
4
5docker pull docker.all-hands.dev/all-hands-ai/runtime:0.48-nikolaik
6
7docker run -it --rm --pull=always \
8 -e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.48-nikolaik \
9 -e LOG_ALL_EVENTS=true \
10 -v /var/run/docker.sock:/var/run/docker.sock \
11 -v ~/.openhands:/.openhands \
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.48vllm (recommended): See heremistral-inference: See heretransformers: See hereLMStudio: See herellama.cpp: See hereollama: See herevLLM >= 0.9.1:pip install vllm --upgrademistral_common >= 1.7.0.pip install mistral-common --upgradepython -c "import mistral_common; print(mistral_common.__version__)"vllm serve mistralai/Devstral-Small-2507 --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-2507"
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
34# Devstral Small 1.1 supports tool calling. If you want to use tools, follow this:
35# tools = [ # Define tools for vLLM
36# {
37# "type": "function",
38# "function": {
39# "name": "git_clone",
40# "description": "Clone a git repository",
41# "parameters": {
42# "type": "object",
43# "properties": {
44# "url": {
45# "type": "string",
46# "description": "The url of the git repository",
47# },
48# },
49# "required": ["url"],
50# },
51# },
52# }
53# ]
54# data = {"model": model, "messages": messages, "temperature": 0.15, "tools": tools} # Pass tools to payload.
55
56response = requests.post(url, headers=headers, data=json.dumps(data))
57print(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-2507", allow_patterns=["params.json", "consolidated.safetensors", "tekken.json"], local_dir=mistral_models_path)mistral-chat $HOME/mistral_models/Devstral --instruct --max_tokens 300mistral-common >= 1.7.0 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 huggingface_hub import hf_hub_download
9from transformers import AutoModelForCausalLM
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
17model_id = "mistralai/Devstral-Small-2507"
18SYSTEM_PROMPT = load_system_prompt(model_id, "SYSTEM_PROMPT.txt")
19
20
21tokenizer = MistralTokenizer.from_hf_hub(model_id)
22model = AutoModelForCausalLM.from_pretrained(model_id)
23
24tokenized = tokenizer.encode_chat_completion(
25 ChatCompletionRequest(
26 messages=[
27 SystemMessage(content=SYSTEM_PROMPT),
28 UserMessage(content="<your-command>"),
29 ],
30 )
31)
32
33output = model.generate(
34 input_ids=torch.tensor([tokenized.tokens]),
35 max_new_tokens=1000,
36)[0]
37
38decoded_output = tokenizer.decode(output[len(tokenized.tokens):])
39print(decoded_output)pip install -U "huggingface_hub[cli]"
huggingface-cli download \
"lmstudio-community/Devstral-Small-2507-GGUF" \ # or mistralai/Devstral-Small-2507_gguf
--include "Devstral-Small-2507-Q4_K_M.gguf" \
--local-dir "Devstral-Small-2507_gguf/"lms cli ~/.lmstudio/bin/lms bootstraplms import Devstral-Small-2507-Q4_K_M.gguf in the directory where you've downloaded the model checkpoint (e.g. Devstral-Small-2507_gguf)Devstral Small 2507. Toggle the status button to start the model, in setting toggle Serve on Local Network to be on.devstral-small-2507 and an api address under API Usage. Keep note of this address, this is used for OpenHands or Cline.pip install -U "huggingface_hub[cli]"
huggingface-cli download \
"mistralai/Devstral-Small-2507_gguf" \
--include "Devstral-Small-2507-Q4_K_M.gguf" \
--local-dir "mistralai/Devstral-Small-2507_gguf/"./llama-server -m mistralai/Devstral-Small-2507_gguf/Devstral-Small-2507-Q4_K_M.gguf -c 0 # -c configure the context size, 0 means model's default, here 128k.Devstral Small 1.1.vllm serve mistralai/Devstral-Small-2507 --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.48-nikolaik
2
3docker run -it --rm --pull=always \
4 -e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.48-nikolaik \
5 -e LOG_ALL_EVENTS=true \
6 -v /var/run/docker.sock:/var/run/docker.sock \
7 -v ~/.openhands:/.openhands \
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.48http://localhost:3000.openai/mistralai/Devstral-Small-2507http://<your-server-url>:8000/v1token (or any other token you used to launch the server if any)
Devstral Small 1.1.vllm serve mistralai/Devstral-Small-2507 --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/v1
mistral-common repo.Check the test coverage of the repo and then create a visualization of test coverage. Try plotting a few different types of graphs and save them to a png.






Create a video game that mixes Space Invaders and Pong for the web.
Follow these instructions:
- There are two players one at the top and one at the bottom. The players are controling a bar to bounce a ball.
- The first player plays with the keys "a" and "d", the second with the right and left arrows.
- The invaders are located at the center of the screen. They shoud look like the ones in Space Invaders. Their goal is to shoot on the players randomly. They cannot be destroyed by the ball that pass through them. This means that invaders never die.
- The players goal is to avoid shootings from the space invaders and send the ball to the edge of the over player.
- The ball bounces on the left and right edges.
- Once the ball touch one of the player's edge, the player loses.
- Once a player is touched 3 times or more by a shooting, the player loses.
- The player winning is the last one standing.
- Display on the UI, the number of times a player touched the ball, and the remaining health.


