apolloparty commited on
Commit
1ecef56
·
verified ·
1 Parent(s): c13165d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +254 -3
README.md CHANGED
@@ -1,3 +1,254 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ - fr
5
+ - de
6
+ - es
7
+ - pt
8
+ - it
9
+ - ja
10
+ - ko
11
+ - ru
12
+ - zh
13
+ - ar
14
+ - fa
15
+ - id
16
+ - ms
17
+ - ne
18
+ - pl
19
+ - ro
20
+ - sr
21
+ - sv
22
+ - tr
23
+ - uk
24
+ - vi
25
+ - hi
26
+ - bn
27
+ license: apache-2.0
28
+ library_name: vllm
29
+ inference: false
30
+ base_model:
31
+ - mistralai/Devstral-Small-2507
32
+ - unsloth/Devstral-Small-2507
33
+ extra_gated_description: >-
34
+ If you want to learn more about how we process your personal data, please read
35
+ our <a href="https://mistral.ai/terms/">Privacy Policy</a>.
36
+ pipeline_tag: text2text-generation
37
+ ---
38
+ # Quantization NVFP4A16
39
+ Quantified from https://huggingface.co/unsloth/Devstral-Small-2507 (due to in-folder tokenizer) using [llm-compressor](https://github.com/vllm-project/llm-compressor)
40
+ This quant is recommended with hardware with cuda capabilities 12.0 (NVIDIA Blackwell GPU, DGX Spark) due to FP4 native acceleration.
41
+
42
+ # Devstral Small 1.1
43
+
44
+ Devstral is an agentic LLM for software engineering tasks built under a collaboration between [Mistral AI](https://mistral.ai/) and [All Hands AI](https://www.all-hands.dev/) 🙌. Devstral excels at using tools to explore codebases, editing multiple files and power software engineering agents. The model achieves remarkable performance on SWE-bench which positionates it as the #1 open source model on this [benchmark](#benchmark-results).
45
+
46
+ It is finetuned from [Mistral-Small-3.1](https://huggingface.co/mistralai/Mistral-Small-3.1-24B-Base-2503), therefore it has a long context window of up to 128k tokens. As a coding agent, Devstral is text-only and before fine-tuning from `Mistral-Small-3.1` the vision encoder was removed.
47
+
48
+ For enterprises requiring specialized capabilities (increased context, domain-specific knowledge, etc.), we will release commercial models beyond what Mistral AI contributes to the community.
49
+
50
+ Learn more about Devstral in our [blog post](https://mistral.ai/news/devstral-2507).
51
+
52
+ **Updates compared to [`Devstral Small 1.0`](https://huggingface.co/mistralai/Devstral-Small-2505):**
53
+ - Improved performance, please refer to the [benchmark results](#benchmark-results).
54
+ - `Devstral Small 1.1` is still great when paired with OpenHands. This new version also generalizes better to other prompts and coding environments.
55
+ - Supports [Mistral's function calling format](https://mistralai.github.io/mistral-common/usage/tools/).
56
+
57
+
58
+ ## Key Features:
59
+ - **Agentic coding**: Devstral is designed to excel at agentic coding tasks, making it a great choice for software engineering agents.
60
+ - **lightweight**: with its compact size of just 24 billion parameters, Devstral NVFP4A16 is light enough to run on a single RTX 5080, making it an appropriate model for local deployment and on-device use.
61
+ - **Apache 2.0 License**: Open license allowing usage and modification for both commercial and non-commercial purposes.
62
+ - **Context Window**: A 128k context window.
63
+ - **Tokenizer**: Utilizes a Tekken tokenizer with a 131k vocabulary size.
64
+
65
+
66
+ ## Benchmark Results
67
+
68
+ ### SWE-Bench
69
+
70
+ Devstral Small 1.1 achieves a score of **53.6%** on SWE-Bench Verified, outperforming Devstral Small 1.0 by +6,8% and the second best state of the art model by +11.4%.
71
+
72
+ | Model | Agentic Scaffold | SWE-Bench Verified (%) |
73
+ |--------------------|--------------------|------------------------|
74
+ | Devstral Small 1.1 | OpenHands Scaffold | **53.6** |
75
+ | Devstral Small 1.0 | OpenHands Scaffold | *46.8* |
76
+ | GPT-4.1-mini | OpenAI Scaffold | 23.6 |
77
+ | Claude 3.5 Haiku | Anthropic Scaffold | 40.6 |
78
+ | SWE-smith-LM 32B | SWE-agent Scaffold | 40.2 |
79
+ | Skywork SWE | OpenHands Scaffold | 38.0 |
80
+ | DeepSWE | R2E-Gym Scaffold | 42.2 |
81
+
82
+
83
+ When evaluated under the same test scaffold (OpenHands, provided by All Hands AI 🙌), Devstral exceeds far larger models such as Deepseek-V3-0324 and Qwen3 232B-A22B.
84
+
85
+ ![SWE Benchmark](assets/swe_benchmark.png)
86
+
87
+ ## Local inference Usage
88
+
89
+ We recommend to use Devstral NVFP4A16 with the [`vLLM >= 0.9.1`](https://github.com/vllm-project/vllm/releases/tag/v0.9.1
90
+ Other methods are untested
91
+
92
+ #### vLLM (recommended, other methods untested)
93
+
94
+ <details>
95
+ <summary>Expand</summary
96
+
97
+ We recommend using this model with the [vLLM library](https://github.com/vllm-project/vllm)
98
+ to implement production-ready inference pipelines.
99
+
100
+ **_Installation_**
101
+ Make sure you install [`vLLM >= 0.9.1`](https://github.com/vllm-project/vllm/releases/tag/v0.9.1):
102
+
103
+ ```
104
+ pip install vllm --extra-index-url https://download.pytorch.org/whl/cu128
105
+ ```
106
+
107
+ Also make sure to have installed [`mistral_common >= 1.7.0`](https://github.com/mistralai/mistral-common/releases/tag/v1.7.0).
108
+
109
+ ```
110
+ pip install mistral-common --upgrade
111
+ ```
112
+
113
+ To check:
114
+ ```
115
+ python -c "import mistral_common; print(mistral_common.__version__)"
116
+ ```
117
+
118
+ You can also make use of a ready-to-go [docker image](https://github.com/vllm-project/vllm/blob/main/Dockerfile) or on the [docker hub](https://hub.docker.com/layers/vllm/vllm-openai/latest/images/sha256-de9032a92ffea7b5c007dad80b38fd44aac11eddc31c435f8e52f3b7404bbf39).
119
+
120
+ **_Launch server_**
121
+
122
+ We recommand that you use Devstral in a server/client setting.
123
+
124
+ 1. Spin up a server:
125
+
126
+ ```
127
+ vllm serve apolloparty/Devstral-Small-2507-NVFP4A16 --tool-call-parser mistral --enable-auto-tool-choice
128
+ ```
129
+
130
+
131
+ 2. To ping the client you can use a simple Python snippet.
132
+
133
+ ```py
134
+ import requests
135
+ import json
136
+ from huggingface_hub import hf_hub_download
137
+
138
+
139
+ url = "http://<your-server-url>:8000/v1/chat/completions"
140
+ headers = {"Content-Type": "application/json", "Authorization": "Bearer token"}
141
+
142
+ model = "apolloparty/Devstral-Small-2507-NVFP4A16"
143
+
144
+ def load_system_prompt(repo_id: str, filename: str) -> str:
145
+ file_path = hf_hub_download(repo_id=repo_id, filename=filename)
146
+ with open(file_path, "r") as file:
147
+ system_prompt = file.read()
148
+ return system_prompt
149
+
150
+ SYSTEM_PROMPT = load_system_prompt(model, "SYSTEM_PROMPT.txt")
151
+
152
+ messages = [
153
+ {"role": "system", "content": SYSTEM_PROMPT},
154
+ {
155
+ "role": "user",
156
+ "content": [
157
+ {
158
+ "type": "text",
159
+ "text": "<your-command>",
160
+ },
161
+ ],
162
+ },
163
+ ]
164
+
165
+ data = {"model": model, "messages": messages, "temperature": 0.15}
166
+
167
+ # Devstral Small 1.1 supports tool calling. If you want to use tools, follow this:
168
+ # tools = [ # Define tools for vLLM
169
+ # {
170
+ # "type": "function",
171
+ # "function": {
172
+ # "name": "git_clone",
173
+ # "description": "Clone a git repository",
174
+ # "parameters": {
175
+ # "type": "object",
176
+ # "properties": {
177
+ # "url": {
178
+ # "type": "string",
179
+ # "description": "The url of the git repository",
180
+ # },
181
+ # },
182
+ # "required": ["url"],
183
+ # },
184
+ # },
185
+ # }
186
+ # ]
187
+ # data = {"model": model, "messages": messages, "temperature": 0.15, "tools": tools} # Pass tools to payload.
188
+
189
+ response = requests.post(url, headers=headers, data=json.dumps(data))
190
+ print(response.json()["choices"][0]["message"]["content"])
191
+ ```
192
+ </details>
193
+
194
+
195
+ ### Cline
196
+
197
+ #### Launch a server to deploy Devstral Small 1.1
198
+
199
+ Make sure you launched an OpenAI-compatible server such as vLLM as described above.
200
+
201
+ In the case of the tutorial we spineed up a vLLM server running the command:
202
+ ```bash
203
+ vllm serve apolloparty/Devstral-Small-2507-NVFP4A16 --tool-call-parser mistral --enable-auto-tool-choice
204
+ ```
205
+
206
+ The server address should be in the following format: `http://<your-server-url>:8000/v1`
207
+
208
+ #### Launch Cline
209
+
210
+ You can follow installation of Cline [here](https://docs.cline.bot/getting-started/installing-cline). Then you can configure the server address in the settings.
211
+
212
+ <details>
213
+ <summary>See settings</summary>
214
+
215
+ ![Cline Settings](assets/cline_config.png)
216
+
217
+ </details>
218
+
219
+
220
+ #### Cline: build a video game
221
+
222
+ First initialize Cline inside VSCode and connect it to the server you launched earlier.
223
+
224
+ We give the following instruction to builde the video game:
225
+ ```
226
+ Create a video game that mixes Space Invaders and Pong for the web.
227
+
228
+ Follow these instructions:
229
+ - There are two players one at the top and one at the bottom. The players are controling a bar to bounce a ball.
230
+ - The first player plays with the keys "a" and "d", the second with the right and left arrows.
231
+ - 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.
232
+ - The players goal is to avoid shootings from the space invaders and send the ball to the edge of the over player.
233
+ - The ball bounces on the left and right edges.
234
+ - Once the ball touch one of the player's edge, the player loses.
235
+ - Once a player is touched 3 times or more by a shooting, the player loses.
236
+ - The player winning is the last one standing.
237
+ - Display on the UI, the number of times a player touched the ball, and the remaining health.
238
+ ```
239
+
240
+ ![space invaders pong - prompt](assets/space_invaders_pong/prompt.png)
241
+
242
+ The agent will first create the game:
243
+
244
+ ![space invaders pong - structure](assets/space_invaders_pong/base_structure.png)
245
+
246
+ Then it will explain how to launch the game:
247
+
248
+ ![space invaders pong - task completed](assets/space_invaders_pong/task%20completed.png)
249
+
250
+ Finally, the game is ready to be played:
251
+
252
+ ![space invaders pong - game](assets/space_invaders_pong/game.png)
253
+
254
+ Don't hesitate to iterate or give more information to Devstral to improve the game!