Commit
·
c4c1159
verified
·
0
Parent(s):
Super-squash branch 'main' using huggingface_hub
Browse filesCo-authored-by: patrickvonplaten <[email protected]>
Co-authored-by: pandora-s <[email protected]>
This view is limited to 50 files because it contains too many changes.
See raw diff
- .gitattributes +37 -0
- CHAT_SYSTEM_PROMPT.txt +29 -0
- LICENSE +10 -0
- README.md +1586 -0
- VIBE_SYSTEM_PROMPT.txt +24 -0
- chat_template.jinja +117 -0
- config.json +49 -0
- consolidated-00001-of-00027.safetensors +3 -0
- consolidated-00002-of-00027.safetensors +3 -0
- consolidated-00003-of-00027.safetensors +3 -0
- consolidated-00004-of-00027.safetensors +3 -0
- consolidated-00005-of-00027.safetensors +3 -0
- consolidated-00006-of-00027.safetensors +3 -0
- consolidated-00007-of-00027.safetensors +3 -0
- consolidated-00008-of-00027.safetensors +3 -0
- consolidated-00009-of-00027.safetensors +3 -0
- consolidated-00010-of-00027.safetensors +3 -0
- consolidated-00011-of-00027.safetensors +3 -0
- consolidated-00012-of-00027.safetensors +3 -0
- consolidated-00013-of-00027.safetensors +3 -0
- consolidated-00014-of-00027.safetensors +3 -0
- consolidated-00015-of-00027.safetensors +3 -0
- consolidated-00016-of-00027.safetensors +3 -0
- consolidated-00017-of-00027.safetensors +3 -0
- consolidated-00018-of-00027.safetensors +3 -0
- consolidated-00019-of-00027.safetensors +3 -0
- consolidated-00020-of-00027.safetensors +3 -0
- consolidated-00021-of-00027.safetensors +3 -0
- consolidated-00022-of-00027.safetensors +3 -0
- consolidated-00023-of-00027.safetensors +3 -0
- consolidated-00024-of-00027.safetensors +3 -0
- consolidated-00025-of-00027.safetensors +3 -0
- consolidated-00026-of-00027.safetensors +3 -0
- consolidated-00027-of-00027.safetensors +3 -0
- consolidated.safetensors.index.json +0 -0
- generation_config.json +8 -0
- model-00001-of-00027.safetensors +3 -0
- model-00002-of-00027.safetensors +3 -0
- model-00003-of-00027.safetensors +3 -0
- model-00004-of-00027.safetensors +3 -0
- model-00005-of-00027.safetensors +3 -0
- model-00006-of-00027.safetensors +3 -0
- model-00007-of-00027.safetensors +3 -0
- model-00008-of-00027.safetensors +3 -0
- model-00009-of-00027.safetensors +3 -0
- model-00010-of-00027.safetensors +3 -0
- model-00011-of-00027.safetensors +3 -0
- model-00012-of-00027.safetensors +3 -0
- model-00013-of-00027.safetensors +3 -0
- model-00014-of-00027.safetensors +3 -0
.gitattributes
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 28 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 29 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 30 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 31 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 32 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 33 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
tekken.json filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
CHAT_SYSTEM_PROMPT.txt
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
You are Devstral-Medium-2-124B-Instruct-2512, a Large Language Model (LLM) created by Mistral AI, a French startup headquartered in Paris.
|
| 2 |
+
You power an AI assistant called Le Chat.
|
| 3 |
+
Your knowledge base was last updated on 2023-10-01.
|
| 4 |
+
The current date is {today}.
|
| 5 |
+
|
| 6 |
+
When you're not sure about some information or when the user's request requires up-to-date or specific data, you must use the available tools to fetch the information. Do not hesitate to use tools whenever they can provide a more accurate or complete response. If no relevant tools are available, then clearly state that you don't have the information and avoid making up anything.
|
| 7 |
+
If the user's question is not clear, ambiguous, or does not provide enough context for you to accurately answer the question, you do not try to answer it right away and you rather ask the user to clarify their request (e.g. "What are some good restaurants around me?" => "Where are you?" or "When is the next flight to Tokyo" => "Where do you travel from?").
|
| 8 |
+
You are always very attentive to dates, in particular you try to resolve dates (e.g. "yesterday" is {yesterday}) and when asked about information at specific dates, you discard information that is at another date.
|
| 9 |
+
You follow these instructions in all languages, and always respond to the user in the language they use or request.
|
| 10 |
+
Next sections describe the capabilities that you have.
|
| 11 |
+
|
| 12 |
+
# WEB BROWSING INSTRUCTIONS
|
| 13 |
+
|
| 14 |
+
You cannot perform any web search or access internet to open URLs, links etc. If it seems like the user is expecting you to do so, you clarify the situation and ask the user to copy paste the text directly in the chat.
|
| 15 |
+
|
| 16 |
+
# MULTI-MODAL INSTRUCTIONS
|
| 17 |
+
|
| 18 |
+
You have the ability to read images, but you cannot generate images. You also cannot transcribe audio files or videos.
|
| 19 |
+
You cannot read nor transcribe audio files or videos.
|
| 20 |
+
|
| 21 |
+
# TOOL CALLING INSTRUCTIONS
|
| 22 |
+
|
| 23 |
+
You may have access to tools that you can use to fetch information or perform actions. You must use these tools in the following situations:
|
| 24 |
+
|
| 25 |
+
1. When the request requires up-to-date information.
|
| 26 |
+
2. When the request requires specific data that you do not have in your knowledge base.
|
| 27 |
+
3. When the request involves actions that you cannot perform without tools.
|
| 28 |
+
|
| 29 |
+
Always prioritize using tools to provide the most accurate and helpful response. If tools are not available, inform the user that you cannot perform the requested action at the moment.
|
LICENSE
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Modified MIT License
|
| 2 |
+
|
| 3 |
+
Attribution notice: 2025 - Mistral AI
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy of the weights of this model and associated documentation files (the “Model”), to deal in the Model without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Model, and to permit persons to whom the Model is furnished to do so, subject to the following conditions:
|
| 6 |
+
|
| 7 |
+
1. The above attribution notice and this permission notice shall be included in all copies or substantial portions of the Model.
|
| 8 |
+
2. You are not authorized to exercise any rights under this license if the global consolidated monthly revenue of your company (or that of your employer) exceeds $20 million (or its equivalent in another currency) for the preceding month. This restriction in (b) applies to the Model and any derivatives, modifications, or combined works based on it, whether provided by Mistral AI or by a third party. You may contact Mistral AI ([email protected]) to request a commercial license, which Mistral AI may grant you at its sole discretion, or choose to use the Model on Mistral AI's hosted services available at https://mistral.ai/.
|
| 9 |
+
|
| 10 |
+
THE MODEL IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL MISTRAL AI BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MODEL OR THE USE OR OTHER DEALINGS IN THE MODEL.
|
README.md
ADDED
|
@@ -0,0 +1,1586 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: vllm
|
| 3 |
+
inference: false
|
| 4 |
+
extra_gated_description: >-
|
| 5 |
+
If you want to learn more about how we process your personal data, please read
|
| 6 |
+
our <a href="https://mistral.ai/terms/">Privacy Policy</a>.
|
| 7 |
+
tags:
|
| 8 |
+
- mistral-common
|
| 9 |
+
license: other
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
# Devstral 2 123B Instruct 2512
|
| 13 |
+
Devstral is an agentic LLM for software engineering tasks. **Devstral 2** excels at using tools to explore codebases, editing multiple files and power software engineering agents.
|
| 14 |
+
The model achieves remarkable performance on SWE-bench.
|
| 15 |
+
|
| 16 |
+
This model is an Instruct model in **FP8**, fine-tuned to follow instructions, making it ideal for chat, agentic and instruction based tasks for SWE use cases.
|
| 17 |
+
|
| 18 |
+
For enterprises requiring specialized capabilities (increased context, domain-specific knowledge, etc.), we invite companies to [reach out to us](https://mistral.ai/contact).
|
| 19 |
+
|
| 20 |
+
## Key Features
|
| 21 |
+
The Devstral 2 Instruct model offers the following capabilities:
|
| 22 |
+
- **Agentic Coding**: Devstral is designed to excel at agentic coding tasks, making it a great choice for software engineering agents.
|
| 23 |
+
- **Improved Performance**: Devstral 2 is a step-up compared to its predecessors.
|
| 24 |
+
- **Better Generalization**: Generalises better to diverse prompts and coding environments.
|
| 25 |
+
- **Context Window**: A 256k context window.
|
| 26 |
+
|
| 27 |
+
### Use Cases
|
| 28 |
+
|
| 29 |
+
AI Code Assistants, Agentic Coding, and Software Engineering Tasks. Leveraging advanced AI capabilities for complex tool integration and deep codebase understanding in coding environments.
|
| 30 |
+
|
| 31 |
+
## Benchmark Results
|
| 32 |
+
|
| 33 |
+
| Model/Benchmark | Size (B Tokens) | SWE Bench Verified | SWE Bench Multilingual | Terminal Bench 2 |
|
| 34 |
+
|-------------------------------|-----------------|--------------------|------------------------|------------------|
|
| 35 |
+
| **Devstral 2** | 123 | 72.2% | 61.3% | 32.6% |
|
| 36 |
+
| **Devstral Small 2** | 24 | 68.0% | 55.7% | 22.5% |
|
| 37 |
+
| | | | | |
|
| 38 |
+
| GLM 4.6 | 455 | 68.0% | -- | 24.6% |
|
| 39 |
+
| Qwen 3 Coder Plus | 480 | 69.6% | 54.7% | 25.4% |
|
| 40 |
+
| MiniMax M2 | 230 | 69.4% | 56.5% | 30.0% |
|
| 41 |
+
| Kimi K2 Thinking | 1000 | 71.3% | 61.1% | 35.7% |
|
| 42 |
+
| DeepSeek v3.2 | 671 | 73.1% | 70.2% | 46.4% |
|
| 43 |
+
| | | | | |
|
| 44 |
+
| GPT 5.1 Codex High | -- | 73.7% | -- | 52.8% |
|
| 45 |
+
| GPT 5.1 Codex Max | -- | 77.9% | -- | 60.4% |
|
| 46 |
+
| Gemini 3 Pro | -- | 76.2% | -- | 54.2% |
|
| 47 |
+
| Claude Sonnet 4.5 | -- | 77.2% | 68.0% | 42.8% |
|
| 48 |
+
|
| 49 |
+
*Benchmark results presented are based on publicly reported values for competitor models.
|
| 50 |
+
|
| 51 |
+
## Usage
|
| 52 |
+
|
| 53 |
+
### Scaffolding
|
| 54 |
+
|
| 55 |
+
Together with Devstral 2, we are releasing **Mistral Vibe**, a CLI tool allowing developers to leverage Devstral capabilities directly in your terminal.
|
| 56 |
+
- [Mistral Vibe (recommended)](https://github.com/mistralai/mistral-vibe): Learn how to use it [here](#mistral-vibe)
|
| 57 |
+
|
| 58 |
+
Devstral 2 can also be used with the following scaffoldings:
|
| 59 |
+
- [Cline](https://github.com/cline/cline)
|
| 60 |
+
- [Kilo Code](https://github.com/Kilo-Org/kilocode)
|
| 61 |
+
- [Claude Code](https://github.com/anthropics/claude-code)
|
| 62 |
+
- [OpenHands](https://github.com/All-Hands-AI/OpenHands/tree/main)
|
| 63 |
+
- [SWE Agent](https://github.com/SWE-agent/SWE-agent)
|
| 64 |
+
|
| 65 |
+
You can use Devstral 2 either through our API or by running locally.
|
| 66 |
+
|
| 67 |
+
#### Mistral Vibe
|
| 68 |
+
|
| 69 |
+
The [Mistral Vibe CLI](https://github.com/mistralai/mistral-vibe) is a command-line tool designed to help developers leverage Devstral’s capabilities directly from their terminal.
|
| 70 |
+
|
| 71 |
+
We recommend installing Mistral Vibe using `uv` for faster and more reliable dependency management:
|
| 72 |
+
```
|
| 73 |
+
uv tool install mistral-vibe
|
| 74 |
+
```
|
| 75 |
+
You can also run:
|
| 76 |
+
```
|
| 77 |
+
curl -LsSf https://mistral.ai/vibe/install.sh | sh
|
| 78 |
+
```
|
| 79 |
+
|
| 80 |
+
If you prefer using pip, use:
|
| 81 |
+
```
|
| 82 |
+
pip install mistral-vibe
|
| 83 |
+
```
|
| 84 |
+
|
| 85 |
+
To launch the CLI, navigate to your project's root directory and simply execute:
|
| 86 |
+
```
|
| 87 |
+
vibe
|
| 88 |
+
```
|
| 89 |
+
|
| 90 |
+
If this is your first time running Vibe, it will:
|
| 91 |
+
- Create a default configuration file at `~/.vibe/config.toml`.
|
| 92 |
+
- Prompt you to enter your API key if it's not already configured, follow these [instructions](https://docs.mistral.ai/getting-started/quickstart/#account-setup) to create an Account and get an API key.
|
| 93 |
+
- Save your API key to `~/.vibe/.env` for future use.
|
| 94 |
+
|
| 95 |
+
### Local Deployment
|
| 96 |
+
|
| 97 |
+
The model can also be deployed with the following libraries, we advise everyone to use the Mistral AI API if the model is subpar with local serving:
|
| 98 |
+
- [`vllm (recommended)`](https://github.com/vllm-project/vllm): See [here](#vllm-recommended)
|
| 99 |
+
- [`transformers`](https://github.com/huggingface/transformers): See [here](#transformers)
|
| 100 |
+
|
| 101 |
+
Coming soon:
|
| 102 |
+
- [`llama.cpp`](https://github.com/ggml-org/llama.cpp)
|
| 103 |
+
- [`ollama`](https://ollama.com/)
|
| 104 |
+
- [`lmstudio`](https://lmstudio.ai/)
|
| 105 |
+
|
| 106 |
+
> [!Note]
|
| 107 |
+
> Current llama.cpp/ollama/lmstudio implementations may not be accurate, we invite developers to test them via the following [prompt tests](#tests).
|
| 108 |
+
|
| 109 |
+
#### vLLM (recommended)
|
| 110 |
+
|
| 111 |
+
<details>
|
| 112 |
+
<summary>Expand</summary
|
| 113 |
+
|
| 114 |
+
We recommend using this model with the [vLLM library](https://github.com/vllm-project/vllm)
|
| 115 |
+
to implement production-ready inference pipelines.
|
| 116 |
+
|
| 117 |
+
**_Installation_**
|
| 118 |
+
|
| 119 |
+
Please make sure to use our custom vLLM docker image [mistralllm/vllm_devstral:latest](https://hub.docker.com/repository/docker/mistralllm/vllm_devstral/tags/latest/sha256:d2ca883e8b4e0bec7d6953706410d2741e88ade6e07e576a51756f4bf51a0ffd):
|
| 120 |
+
|
| 121 |
+
```
|
| 122 |
+
docker pull mistralllm/vllm_devstral:latest
|
| 123 |
+
docker run -it mistralllm/vllm_devstral:latest
|
| 124 |
+
```
|
| 125 |
+
|
| 126 |
+
Alternatively, you can also install `vllm` from latest main by following instructions [here](https://docs.vllm.ai/en/latest/getting_started/installation/gpu/#python-only-build).
|
| 127 |
+
|
| 128 |
+
> [!Warning]
|
| 129 |
+
> Make sure that your vllm installation includes [this commit](https://github.com/vllm-project/vllm/commit/5c213d2899f5a2d439c8d771a0abc156a5412a2b).
|
| 130 |
+
> If you do not have this commit included, you will get incorrectly parsed tool calls.
|
| 131 |
+
|
| 132 |
+
Also make sure to have installed [`mistral_common >= 1.8.6`](https://github.com/mistralai/mistral-common/releases/tag/v1.8.6).
|
| 133 |
+
To check:
|
| 134 |
+
```
|
| 135 |
+
python -c "import mistral_common; print(mistral_common.__version__)"
|
| 136 |
+
```
|
| 137 |
+
|
| 138 |
+
**_Launch server_**
|
| 139 |
+
|
| 140 |
+
We recommand that you use Devstral in a server/client setting.
|
| 141 |
+
|
| 142 |
+
1. Spin up a server:
|
| 143 |
+
|
| 144 |
+
```
|
| 145 |
+
vllm serve mistralai/Devstral-2-123B-Instruct-2512 --tool-call-parser mistral --enable-auto-tool-choice --tensor-parallel-size 8
|
| 146 |
+
```
|
| 147 |
+
|
| 148 |
+
|
| 149 |
+
2. To ping the client you can use a simple Python snippet.
|
| 150 |
+
|
| 151 |
+
```py
|
| 152 |
+
import requests
|
| 153 |
+
import json
|
| 154 |
+
from huggingface_hub import hf_hub_download
|
| 155 |
+
|
| 156 |
+
|
| 157 |
+
url = "http://<your-server-url>:8000/v1/chat/completions"
|
| 158 |
+
headers = {"Content-Type": "application/json", "Authorization": "Bearer token"}
|
| 159 |
+
|
| 160 |
+
model = "mistralai/Devstral-2-123B-Instruct-2512"
|
| 161 |
+
|
| 162 |
+
def load_system_prompt(repo_id: str, filename: str) -> str:
|
| 163 |
+
file_path = hf_hub_download(repo_id=repo_id, filename=filename)
|
| 164 |
+
with open(file_path, "r") as file:
|
| 165 |
+
system_prompt = file.read()
|
| 166 |
+
return system_prompt
|
| 167 |
+
|
| 168 |
+
SYSTEM_PROMPT = load_system_prompt(model, "CHAT_SYSTEM_PROMPT.txt")
|
| 169 |
+
|
| 170 |
+
messages = [
|
| 171 |
+
{"role": "system", "content": SYSTEM_PROMPT},
|
| 172 |
+
{
|
| 173 |
+
"role": "user",
|
| 174 |
+
"content": [
|
| 175 |
+
{
|
| 176 |
+
"type": "text",
|
| 177 |
+
"text": "<your-command>",
|
| 178 |
+
},
|
| 179 |
+
],
|
| 180 |
+
},
|
| 181 |
+
]
|
| 182 |
+
|
| 183 |
+
data = {"model": model, "messages": messages, "temperature": 0.15}
|
| 184 |
+
|
| 185 |
+
# Devstral 2 supports tool calling. If you want to use tools, follow this:
|
| 186 |
+
# tools = [ # Define tools for vLLM
|
| 187 |
+
# {
|
| 188 |
+
# "type": "function",
|
| 189 |
+
# "function": {
|
| 190 |
+
# "name": "git_clone",
|
| 191 |
+
# "description": "Clone a git repository",
|
| 192 |
+
# "parameters": {
|
| 193 |
+
# "type": "object",
|
| 194 |
+
# "properties": {
|
| 195 |
+
# "url": {
|
| 196 |
+
# "type": "string",
|
| 197 |
+
# "description": "The url of the git repository",
|
| 198 |
+
# },
|
| 199 |
+
# },
|
| 200 |
+
# "required": ["url"],
|
| 201 |
+
# },
|
| 202 |
+
# },
|
| 203 |
+
# }
|
| 204 |
+
# ]
|
| 205 |
+
# data = {"model": model, "messages": messages, "temperature": 0.15, "tools": tools} # Pass tools to payload.
|
| 206 |
+
|
| 207 |
+
response = requests.post(url, headers=headers, data=json.dumps(data))
|
| 208 |
+
print(response.json()["choices"][0]["message"]["content"])
|
| 209 |
+
```
|
| 210 |
+
</details>
|
| 211 |
+
|
| 212 |
+
#### Transformers
|
| 213 |
+
|
| 214 |
+
<details>
|
| 215 |
+
<summary>Expand</summary
|
| 216 |
+
|
| 217 |
+
Make sure to install from main:
|
| 218 |
+
|
| 219 |
+
```sh
|
| 220 |
+
uv pip install git+https://github.com/huggingface/transformers
|
| 221 |
+
```
|
| 222 |
+
|
| 223 |
+
And run the following code snippet:
|
| 224 |
+
|
| 225 |
+
```python
|
| 226 |
+
from transformers import (
|
| 227 |
+
MistralForCausalLM,
|
| 228 |
+
MistralCommonBackend,
|
| 229 |
+
)
|
| 230 |
+
|
| 231 |
+
model_id = "mistralai/Devstral-2-123B-Instruct-2512"
|
| 232 |
+
|
| 233 |
+
tokenizer = MistralCommonBackend.from_pretrained(model_id)
|
| 234 |
+
model = MistralForCausalLM.from_pretrained(model_id, device_map="auto")
|
| 235 |
+
|
| 236 |
+
SP = """You are operating as and within Mistral Vibe, a CLI coding-agent built by Mistral AI and powered by default by the Devstral family of models. It wraps Mistral's Devstral models to enable natural language interaction with a local codebase. Use the available tools when helpful.
|
| 237 |
+
|
| 238 |
+
You can:
|
| 239 |
+
|
| 240 |
+
- Receive user prompts, project context, and files.
|
| 241 |
+
- Send responses and emit function calls (e.g., shell commands, code edits).
|
| 242 |
+
- Apply patches, run commands, based on user approvals.
|
| 243 |
+
|
| 244 |
+
Answer the user's request using the relevant tool(s), if they are available. Check that all the required parameters for each tool call are provided or can reasonably be inferred from context. IF there are no relevant tools or there are missing values for required parameters, ask the user to supply these values; otherwise proceed with the tool calls. If the user provides a specific value for a parameter (for example provided in quotes), make sure to use that value EXACTLY. DO NOT make up values for or ask about optional parameters. Carefully analyze descriptive terms in the request as they may indicate required parameter values that should be included even if not explicitly quoted.
|
| 245 |
+
|
| 246 |
+
Always try your hardest to use the tools to answer the user's request. If you can't use the tools, explain why and ask the user for more information.
|
| 247 |
+
|
| 248 |
+
Act as an agentic assistant, if a user asks for a long task, break it down and do it step by step.
|
| 249 |
+
|
| 250 |
+
When you want to commit changes, you will always use the 'git commit' bash command. It will always
|
| 251 |
+
be suffixed with a line telling it was generated by Mistral Vibe with the appropriate co-authoring information.
|
| 252 |
+
The format you will always uses is the following heredoc.
|
| 253 |
+
|
| 254 |
+
```bash
|
| 255 |
+
git commit -m "<Commit message here>
|
| 256 |
+
|
| 257 |
+
Generated by Mistral Vibe.
|
| 258 |
+
Co-Authored-By: Mistral Vibe <[email protected]>"
|
| 259 |
+
```"""
|
| 260 |
+
|
| 261 |
+
input = {
|
| 262 |
+
"messages": [
|
| 263 |
+
{
|
| 264 |
+
"role": "system",
|
| 265 |
+
"content": SP,
|
| 266 |
+
},
|
| 267 |
+
{
|
| 268 |
+
"role": "user",
|
| 269 |
+
"content": [
|
| 270 |
+
{
|
| 271 |
+
"type": "text",
|
| 272 |
+
"text": "Can you implement in Python a method to compute the fibonnaci sequence at the `n`th element with `n` a parameter passed to the function ? You should start the sequence from 1, previous values are invalid.\nThen run the Python code for the function for n=5 and give the answer.",
|
| 273 |
+
}
|
| 274 |
+
],
|
| 275 |
+
},
|
| 276 |
+
],
|
| 277 |
+
"tools": [
|
| 278 |
+
{
|
| 279 |
+
"type": "function",
|
| 280 |
+
"function": {
|
| 281 |
+
"name": "add_number",
|
| 282 |
+
"description": "Add two numbers.",
|
| 283 |
+
"parameters": {
|
| 284 |
+
"type": "object",
|
| 285 |
+
"properties": {
|
| 286 |
+
"a": {"type": "string", "description": "The first number."},
|
| 287 |
+
"b": {"type": "string", "description": "The second number."},
|
| 288 |
+
},
|
| 289 |
+
"required": ["a", "b"],
|
| 290 |
+
},
|
| 291 |
+
},
|
| 292 |
+
},
|
| 293 |
+
{
|
| 294 |
+
"type": "function",
|
| 295 |
+
"function": {
|
| 296 |
+
"name": "multiply_number",
|
| 297 |
+
"description": "Multiply two numbers.",
|
| 298 |
+
"parameters": {
|
| 299 |
+
"type": "object",
|
| 300 |
+
"properties": {
|
| 301 |
+
"a": {"type": "string", "description": "The first number."},
|
| 302 |
+
"b": {"type": "string", "description": "The second number."},
|
| 303 |
+
},
|
| 304 |
+
"required": ["a", "b"],
|
| 305 |
+
},
|
| 306 |
+
},
|
| 307 |
+
},
|
| 308 |
+
{
|
| 309 |
+
"type": "function",
|
| 310 |
+
"function": {
|
| 311 |
+
"name": "substract_number",
|
| 312 |
+
"description": "Substract two numbers.",
|
| 313 |
+
"parameters": {
|
| 314 |
+
"type": "object",
|
| 315 |
+
"properties": {
|
| 316 |
+
"a": {"type": "string", "description": "The first number."},
|
| 317 |
+
"b": {"type": "string", "description": "The second number."},
|
| 318 |
+
},
|
| 319 |
+
"required": ["a", "b"],
|
| 320 |
+
},
|
| 321 |
+
},
|
| 322 |
+
},
|
| 323 |
+
{
|
| 324 |
+
"type": "function",
|
| 325 |
+
"function": {
|
| 326 |
+
"name": "write_a_story",
|
| 327 |
+
"description": "Write a story about science fiction and people with badass laser sabers.",
|
| 328 |
+
"parameters": {},
|
| 329 |
+
},
|
| 330 |
+
},
|
| 331 |
+
{
|
| 332 |
+
"type": "function",
|
| 333 |
+
"function": {
|
| 334 |
+
"name": "terminal",
|
| 335 |
+
"description": "Perform operations from the terminal.",
|
| 336 |
+
"parameters": {
|
| 337 |
+
"type": "object",
|
| 338 |
+
"properties": {
|
| 339 |
+
"command": {
|
| 340 |
+
"type": "string",
|
| 341 |
+
"description": "The command you wish to launch, e.g `ls`, `rm`, ...",
|
| 342 |
+
},
|
| 343 |
+
"args": {
|
| 344 |
+
"type": "string",
|
| 345 |
+
"description": "The arguments to pass to the command.",
|
| 346 |
+
},
|
| 347 |
+
},
|
| 348 |
+
"required": ["command"],
|
| 349 |
+
},
|
| 350 |
+
},
|
| 351 |
+
},
|
| 352 |
+
{
|
| 353 |
+
"type": "function",
|
| 354 |
+
"function": {
|
| 355 |
+
"name": "python",
|
| 356 |
+
"description": "Call a Python interpreter with some Python code that will be ran.",
|
| 357 |
+
"parameters": {
|
| 358 |
+
"type": "object",
|
| 359 |
+
"properties": {
|
| 360 |
+
"code": {
|
| 361 |
+
"type": "string",
|
| 362 |
+
"description": "The Python code to run",
|
| 363 |
+
},
|
| 364 |
+
"result_variable": {
|
| 365 |
+
"type": "string",
|
| 366 |
+
"description": "Variable containing the result you'd like to retrieve from the execution.",
|
| 367 |
+
},
|
| 368 |
+
},
|
| 369 |
+
"required": ["code", "result_variable"],
|
| 370 |
+
},
|
| 371 |
+
},
|
| 372 |
+
},
|
| 373 |
+
],
|
| 374 |
+
}
|
| 375 |
+
|
| 376 |
+
tokenized = tokenizer.apply_chat_template(
|
| 377 |
+
conversation=input["messages"],
|
| 378 |
+
tools=input["tools"],
|
| 379 |
+
return_tensors="pt",
|
| 380 |
+
return_dict=True,
|
| 381 |
+
)
|
| 382 |
+
|
| 383 |
+
input_ids = tokenized["input_ids"].to(device="cuda")
|
| 384 |
+
|
| 385 |
+
output = model.generate(
|
| 386 |
+
input_ids,
|
| 387 |
+
max_new_tokens=200,
|
| 388 |
+
)[0]
|
| 389 |
+
|
| 390 |
+
decoded_output = tokenizer.decode(output[len(tokenized["input_ids"][0]) :])
|
| 391 |
+
print(decoded_output)
|
| 392 |
+
```
|
| 393 |
+
|
| 394 |
+
</details>
|
| 395 |
+
|
| 396 |
+
## Tests
|
| 397 |
+
|
| 398 |
+
To help test our model via vLLM or test that other frameworks' implementations are correct, here is a set of prompts you can try with the expected outputs.
|
| 399 |
+
|
| 400 |
+
1. Call one tool
|
| 401 |
+
|
| 402 |
+
<details>
|
| 403 |
+
<summary>Messages and tools</summary>
|
| 404 |
+
|
| 405 |
+
```python
|
| 406 |
+
messages = [
|
| 407 |
+
{"role": "system", "content": SYSTEM_PROMPT},
|
| 408 |
+
{
|
| 409 |
+
"role": "user",
|
| 410 |
+
"content": [
|
| 411 |
+
{
|
| 412 |
+
"type": "text",
|
| 413 |
+
"text": "Could you write me a story ?",
|
| 414 |
+
},
|
| 415 |
+
],
|
| 416 |
+
},
|
| 417 |
+
]
|
| 418 |
+
tools = [
|
| 419 |
+
{
|
| 420 |
+
"type": "function",
|
| 421 |
+
"function": {
|
| 422 |
+
"name": "add_number",
|
| 423 |
+
"description": "Add two numbers.",
|
| 424 |
+
"parameters": {
|
| 425 |
+
"type": "object",
|
| 426 |
+
"properties": {
|
| 427 |
+
"a": {
|
| 428 |
+
"type": "string",
|
| 429 |
+
"description": "The first number.",
|
| 430 |
+
},
|
| 431 |
+
"b": {
|
| 432 |
+
"type": "string",
|
| 433 |
+
"description": "The second number.",
|
| 434 |
+
},
|
| 435 |
+
},
|
| 436 |
+
"required": ["a", "b"],
|
| 437 |
+
},
|
| 438 |
+
},
|
| 439 |
+
},
|
| 440 |
+
{
|
| 441 |
+
"type": "function",
|
| 442 |
+
"function": {
|
| 443 |
+
"name": "multiply_number",
|
| 444 |
+
"description": "Multiply two numbers.",
|
| 445 |
+
"parameters": {
|
| 446 |
+
"type": "object",
|
| 447 |
+
"properties": {
|
| 448 |
+
"a": {
|
| 449 |
+
"type": "string",
|
| 450 |
+
"description": "The first number.",
|
| 451 |
+
},
|
| 452 |
+
"b": {
|
| 453 |
+
"type": "string",
|
| 454 |
+
"description": "The second number.",
|
| 455 |
+
},
|
| 456 |
+
},
|
| 457 |
+
"required": ["a", "b"],
|
| 458 |
+
},
|
| 459 |
+
},
|
| 460 |
+
},
|
| 461 |
+
{
|
| 462 |
+
"type": "function",
|
| 463 |
+
"function": {
|
| 464 |
+
"name": "substract_number",
|
| 465 |
+
"description": "Substract two numbers.",
|
| 466 |
+
"parameters": {
|
| 467 |
+
"type": "object",
|
| 468 |
+
"properties": {
|
| 469 |
+
"a": {
|
| 470 |
+
"type": "string",
|
| 471 |
+
"description": "The first number.",
|
| 472 |
+
},
|
| 473 |
+
"b": {
|
| 474 |
+
"type": "string",
|
| 475 |
+
"description": "The second number.",
|
| 476 |
+
},
|
| 477 |
+
},
|
| 478 |
+
"required": ["a", "b"],
|
| 479 |
+
},
|
| 480 |
+
},
|
| 481 |
+
},
|
| 482 |
+
{
|
| 483 |
+
"type": "function",
|
| 484 |
+
"function": {
|
| 485 |
+
"name": "write_a_story",
|
| 486 |
+
"description": "Write a story about science fiction and people with badass laser sabers.",
|
| 487 |
+
"parameters": {},
|
| 488 |
+
},
|
| 489 |
+
},
|
| 490 |
+
{
|
| 491 |
+
"type": "function",
|
| 492 |
+
"function": {
|
| 493 |
+
"name": "terminal",
|
| 494 |
+
"description": "Perform operations from the terminal.",
|
| 495 |
+
"parameters": {
|
| 496 |
+
"type": "object",
|
| 497 |
+
"properties": {
|
| 498 |
+
"command": {
|
| 499 |
+
"type": "string",
|
| 500 |
+
"description": "The command you wish to launch, e.g `ls`, `rm`, ...",
|
| 501 |
+
},
|
| 502 |
+
"args": {
|
| 503 |
+
"type": "string",
|
| 504 |
+
"description": "The arguments to pass to the command.",
|
| 505 |
+
},
|
| 506 |
+
},
|
| 507 |
+
"required": ["command"],
|
| 508 |
+
},
|
| 509 |
+
},
|
| 510 |
+
},
|
| 511 |
+
{
|
| 512 |
+
"type": "function",
|
| 513 |
+
"function": {
|
| 514 |
+
"name": "python",
|
| 515 |
+
"description": "Call a Python interpreter with some Python code that will be ran.",
|
| 516 |
+
"parameters": {
|
| 517 |
+
"type": "object",
|
| 518 |
+
"properties": {
|
| 519 |
+
"code": {
|
| 520 |
+
"type": "string",
|
| 521 |
+
"description": "The Python code to run",
|
| 522 |
+
},
|
| 523 |
+
"result_variable": {
|
| 524 |
+
"type": "string",
|
| 525 |
+
"description": "Variable containing the result you'd like to retrieve from the execution.",
|
| 526 |
+
},
|
| 527 |
+
},
|
| 528 |
+
"required": ["code", "result_variable"],
|
| 529 |
+
},
|
| 530 |
+
},
|
| 531 |
+
},
|
| 532 |
+
]
|
| 533 |
+
```
|
| 534 |
+
|
| 535 |
+
</details>
|
| 536 |
+
|
| 537 |
+
<details>
|
| 538 |
+
<summary>Expected output trace</summary>
|
| 539 |
+
|
| 540 |
+
```json
|
| 541 |
+
[
|
| 542 |
+
{
|
| 543 |
+
"role": "assistant",
|
| 544 |
+
"tool_calls": [
|
| 545 |
+
{
|
| 546 |
+
"id": "chatcmpl-tool-8a1f267a212e66e5",
|
| 547 |
+
"function": {
|
| 548 |
+
"arguments": "{}",
|
| 549 |
+
"name": "write_a_story"
|
| 550 |
+
},
|
| 551 |
+
"type": "function"
|
| 552 |
+
}
|
| 553 |
+
],
|
| 554 |
+
"content": null
|
| 555 |
+
},
|
| 556 |
+
{
|
| 557 |
+
"role": "tool",
|
| 558 |
+
"tool_call_id": "chatcmpl-tool-8a1f267a212e66e5",
|
| 559 |
+
"name": "write_a_story",
|
| 560 |
+
"content": "A long time ago in a galaxy far, far away..."
|
| 561 |
+
},
|
| 562 |
+
{
|
| 563 |
+
"role": "assistant",
|
| 564 |
+
"tool_calls": [],
|
| 565 |
+
"content": "A long time ago in a galaxy far, far away, there was a planet called Eldoria, known for its breathtaking landscapes and advanced civilization. The people of Eldoria were not just ordinary beings; they were warriors, scientists, and dreamers, all wielding the power of laser sabers.\n\nAmong them was a young warrior named Kael. Kael was not like the others. While his peers trained rigorously to master the art of the laser saber, Kael was more interested in the science behind it. He spent his days in the ancient libraries of Eldoria, deciphering the secrets of the laser sabers and the energy that powered them.\n\nOne day, Kael discovered an old, forgotten text that spoke of a legendary laser saber, the \"Eldoria Star,\" said to be the most powerful weapon in the galaxy. According to the text, the Eldoria Star was hidden in the heart of the planet's core, guarded by an ancient force.\n\nDriven by curiosity and a desire to protect his planet, Kael set out on a perilous journey to find the Eldoria Star. Along the way, he encountered various challenges and made unlikely allies, each with their own unique skills and laser sabers.\n\nThere was Lyra, a cunning thief with a laser saber that could change colors; Zara, a wise old sage who could manipulate energy fields; and Jax, a former enemy turned ally, whose laser saber was as fierce as his spirit.\n\nTogether, they faced the trials set before them, each step bringing them closer to the heart of Eldoria. As they ventured deeper, they uncovered the truth about the Eldoria Star and the ancient force guarding it.\n\nThe ancient force, known as the \"Guardian,\" revealed that the Eldoria Star was not just a weapon, but a source of immense energy that could either save or destroy the galaxy. It was a test of the warriors' hearts and minds.\n\nKael and his allies faced the ultimate challenge, proving their worth and their commitment to protecting the galaxy. In the end, they succeeded, not by wielding the Eldoria Star, but by understanding its true power and using it to restore balance to the galaxy.\n\nWith the Eldoria Star secured and the galaxy at peace, Kael and his allies returned to their lives, forever changed by their journey. Kael continued his studies, now with a deeper understanding of the laser sabers and the energy that powered them.\n\nAnd so, the legend of the Eldoria Star and the warriors who found it became a tale told for generations, a reminder of the power of knowledge, courage, and the unbreakable bond of friendship."
|
| 566 |
+
}
|
| 567 |
+
]
|
| 568 |
+
```
|
| 569 |
+
</details>
|
| 570 |
+
|
| 571 |
+
2. Call tools one at a time subsequently
|
| 572 |
+
|
| 573 |
+
<details>
|
| 574 |
+
<summary>Messages and tools</summary>
|
| 575 |
+
|
| 576 |
+
```python
|
| 577 |
+
messages = [
|
| 578 |
+
{"role": "system", "content": SYSTEM_PROMPT},
|
| 579 |
+
{
|
| 580 |
+
"role": "user",
|
| 581 |
+
"content": [
|
| 582 |
+
{
|
| 583 |
+
"type": "text",
|
| 584 |
+
"text": "\n1. 6 + 2 x 3\n2. 3a + 7b - 2a\n19 - (8+2) + 1\n4. 5y (6x - 7).\n\nCompute the results steps by steps for the equations that involve only numbers ? You have to call tools to perform the operations and can do one operation at a time per equation."
|
| 585 |
+
},
|
| 586 |
+
]
|
| 587 |
+
}
|
| 588 |
+
]
|
| 589 |
+
tools = [
|
| 590 |
+
{
|
| 591 |
+
"type": "function",
|
| 592 |
+
"function": {
|
| 593 |
+
"name": "add_number",
|
| 594 |
+
"description": "Add two numbers.",
|
| 595 |
+
"parameters": {
|
| 596 |
+
"type": "object",
|
| 597 |
+
"properties": {
|
| 598 |
+
"a": {
|
| 599 |
+
"type": "string",
|
| 600 |
+
"description": "The first number.",
|
| 601 |
+
},
|
| 602 |
+
"b": {
|
| 603 |
+
"type": "string",
|
| 604 |
+
"description": "The second number.",
|
| 605 |
+
},
|
| 606 |
+
},
|
| 607 |
+
"required": ["a", "b"],
|
| 608 |
+
},
|
| 609 |
+
},
|
| 610 |
+
},
|
| 611 |
+
{
|
| 612 |
+
"type": "function",
|
| 613 |
+
"function": {
|
| 614 |
+
"name": "multiply_number",
|
| 615 |
+
"description": "Multiply two numbers.",
|
| 616 |
+
"parameters": {
|
| 617 |
+
"type": "object",
|
| 618 |
+
"properties": {
|
| 619 |
+
"a": {
|
| 620 |
+
"type": "string",
|
| 621 |
+
"description": "The first number.",
|
| 622 |
+
},
|
| 623 |
+
"b": {
|
| 624 |
+
"type": "string",
|
| 625 |
+
"description": "The second number.",
|
| 626 |
+
},
|
| 627 |
+
},
|
| 628 |
+
"required": ["a", "b"],
|
| 629 |
+
},
|
| 630 |
+
},
|
| 631 |
+
},
|
| 632 |
+
{
|
| 633 |
+
"type": "function",
|
| 634 |
+
"function": {
|
| 635 |
+
"name": "substract_number",
|
| 636 |
+
"description": "Substract two numbers.",
|
| 637 |
+
"parameters": {
|
| 638 |
+
"type": "object",
|
| 639 |
+
"properties": {
|
| 640 |
+
"a": {
|
| 641 |
+
"type": "string",
|
| 642 |
+
"description": "The first number.",
|
| 643 |
+
},
|
| 644 |
+
"b": {
|
| 645 |
+
"type": "string",
|
| 646 |
+
"description": "The second number.",
|
| 647 |
+
},
|
| 648 |
+
},
|
| 649 |
+
"required": ["a", "b"],
|
| 650 |
+
},
|
| 651 |
+
},
|
| 652 |
+
},
|
| 653 |
+
{
|
| 654 |
+
"type": "function",
|
| 655 |
+
"function": {
|
| 656 |
+
"name": "write_a_story",
|
| 657 |
+
"description": "Write a story about science fiction and people with badass laser sabers.",
|
| 658 |
+
"parameters": {},
|
| 659 |
+
},
|
| 660 |
+
},
|
| 661 |
+
{
|
| 662 |
+
"type": "function",
|
| 663 |
+
"function": {
|
| 664 |
+
"name": "terminal",
|
| 665 |
+
"description": "Perform operations from the terminal.",
|
| 666 |
+
"parameters": {
|
| 667 |
+
"type": "object",
|
| 668 |
+
"properties": {
|
| 669 |
+
"command": {
|
| 670 |
+
"type": "string",
|
| 671 |
+
"description": "The command you wish to launch, e.g `ls`, `rm`, ...",
|
| 672 |
+
},
|
| 673 |
+
"args": {
|
| 674 |
+
"type": "string",
|
| 675 |
+
"description": "The arguments to pass to the command.",
|
| 676 |
+
},
|
| 677 |
+
},
|
| 678 |
+
"required": ["command"],
|
| 679 |
+
},
|
| 680 |
+
},
|
| 681 |
+
},
|
| 682 |
+
{
|
| 683 |
+
"type": "function",
|
| 684 |
+
"function": {
|
| 685 |
+
"name": "python",
|
| 686 |
+
"description": "Call a Python interpreter with some Python code that will be ran.",
|
| 687 |
+
"parameters": {
|
| 688 |
+
"type": "object",
|
| 689 |
+
"properties": {
|
| 690 |
+
"code": {
|
| 691 |
+
"type": "string",
|
| 692 |
+
"description": "The Python code to run",
|
| 693 |
+
},
|
| 694 |
+
"result_variable": {
|
| 695 |
+
"type": "string",
|
| 696 |
+
"description": "Variable containing the result you'd like to retrieve from the execution.",
|
| 697 |
+
},
|
| 698 |
+
},
|
| 699 |
+
"required": ["code", "result_variable"],
|
| 700 |
+
},
|
| 701 |
+
},
|
| 702 |
+
},
|
| 703 |
+
]
|
| 704 |
+
```
|
| 705 |
+
|
| 706 |
+
</details>
|
| 707 |
+
|
| 708 |
+
<details>
|
| 709 |
+
<summary>Expected output trace</summary>
|
| 710 |
+
|
| 711 |
+
```json
|
| 712 |
+
[
|
| 713 |
+
{
|
| 714 |
+
"role": "assistant",
|
| 715 |
+
"tool_calls": [
|
| 716 |
+
{
|
| 717 |
+
"id": "chatcmpl-tool-84aa136ef835f886",
|
| 718 |
+
"function": {
|
| 719 |
+
"arguments": "{\"a\": \"2\", \"b\": \"3\"}",
|
| 720 |
+
"name": "multiply_number"
|
| 721 |
+
},
|
| 722 |
+
"type": "function"
|
| 723 |
+
}
|
| 724 |
+
],
|
| 725 |
+
"content": "Let's compute the results step by step for the equations that involve only numbers.\n\n### 1. \\( 6 + 2 \\times 3 \\)\n\nFirst, we perform the multiplication \\( 2 \\times 3 \\):\n"
|
| 726 |
+
},
|
| 727 |
+
{
|
| 728 |
+
"role": "tool",
|
| 729 |
+
"tool_call_id": "chatcmpl-tool-84aa136ef835f886",
|
| 730 |
+
"name": "multiply_number",
|
| 731 |
+
"content": "6.0"
|
| 732 |
+
},
|
| 733 |
+
{
|
| 734 |
+
"role": "assistant",
|
| 735 |
+
"tool_calls": [
|
| 736 |
+
{
|
| 737 |
+
"id": "chatcmpl-tool-bedc049b0a248952",
|
| 738 |
+
"function": {
|
| 739 |
+
"arguments": "{\"a\": \"6\", \"b\": \"6\"}",
|
| 740 |
+
"name": "add_number"
|
| 741 |
+
},
|
| 742 |
+
"type": "function"
|
| 743 |
+
}
|
| 744 |
+
],
|
| 745 |
+
"content": "Now, we add the result to 6:\n"
|
| 746 |
+
},
|
| 747 |
+
{
|
| 748 |
+
"role": "tool",
|
| 749 |
+
"tool_call_id": "chatcmpl-tool-bedc049b0a248952",
|
| 750 |
+
"name": "add_number",
|
| 751 |
+
"content": "12.0"
|
| 752 |
+
},
|
| 753 |
+
{
|
| 754 |
+
"role": "assistant",
|
| 755 |
+
"tool_calls": [
|
| 756 |
+
{
|
| 757 |
+
"id": "chatcmpl-tool-ae4558bc0558f4e7",
|
| 758 |
+
"function": {
|
| 759 |
+
"arguments": "{\"a\": \"8\", \"b\": \"2\"}",
|
| 760 |
+
"name": "add_number"
|
| 761 |
+
},
|
| 762 |
+
"type": "function"
|
| 763 |
+
}
|
| 764 |
+
],
|
| 765 |
+
"content": "The result of \\( 6 + 2 \\times 3 \\) is **12**.\n\n---\n\n### 3. \\( 19 - (8 + 2) + 1 \\)\n\nFirst, we compute the expression inside the parentheses \\( 8 + 2 \\):\n"
|
| 766 |
+
},
|
| 767 |
+
{
|
| 768 |
+
"role": "tool",
|
| 769 |
+
"tool_call_id": "chatcmpl-tool-ae4558bc0558f4e7",
|
| 770 |
+
"name": "add_number",
|
| 771 |
+
"content": "10.0"
|
| 772 |
+
},
|
| 773 |
+
{
|
| 774 |
+
"role": "assistant",
|
| 775 |
+
"tool_calls": [
|
| 776 |
+
{
|
| 777 |
+
"id": "chatcmpl-tool-b21f003d298e65df",
|
| 778 |
+
"function": {
|
| 779 |
+
"arguments": "{\"a\": \"19\", \"b\": \"10\"}",
|
| 780 |
+
"name": "substract_number"
|
| 781 |
+
},
|
| 782 |
+
"type": "function"
|
| 783 |
+
}
|
| 784 |
+
],
|
| 785 |
+
"content": "Next, we subtract the result from 19:\n"
|
| 786 |
+
},
|
| 787 |
+
{
|
| 788 |
+
"role": "tool",
|
| 789 |
+
"tool_call_id": "chatcmpl-tool-b21f003d298e65df",
|
| 790 |
+
"name": "substract_number",
|
| 791 |
+
"content": "9.0"
|
| 792 |
+
},
|
| 793 |
+
{
|
| 794 |
+
"role": "assistant",
|
| 795 |
+
"tool_calls": [
|
| 796 |
+
{
|
| 797 |
+
"id": "chatcmpl-tool-bb7628cded899f04",
|
| 798 |
+
"function": {
|
| 799 |
+
"arguments": "{\"a\": \"9\", \"b\": \"1\"}",
|
| 800 |
+
"name": "add_number"
|
| 801 |
+
},
|
| 802 |
+
"type": "function"
|
| 803 |
+
}
|
| 804 |
+
],
|
| 805 |
+
"content": "Finally, we add 1 to the result:\n"
|
| 806 |
+
},
|
| 807 |
+
{
|
| 808 |
+
"role": "tool",
|
| 809 |
+
"tool_call_id": "chatcmpl-tool-bb7628cded899f04",
|
| 810 |
+
"name": "add_number",
|
| 811 |
+
"content": "10.0"
|
| 812 |
+
},
|
| 813 |
+
{
|
| 814 |
+
"role": "assistant",
|
| 815 |
+
"tool_calls": [],
|
| 816 |
+
"content": "The result of \\( 19 - (8 + 2) + 1 \\) is **10**.\n\n---\n\n### Summary of Results:\n1. \\( 6 + 2 \\times 3 = 12 \\)\n3. \\( 19 - (8 + 2) + 1 = 10 \\)"
|
| 817 |
+
}
|
| 818 |
+
]
|
| 819 |
+
```
|
| 820 |
+
|
| 821 |
+
</details>
|
| 822 |
+
|
| 823 |
+
3. Long context
|
| 824 |
+
|
| 825 |
+
<details>
|
| 826 |
+
<summary>Messages and tools</summary>
|
| 827 |
+
|
| 828 |
+
```python
|
| 829 |
+
messages = [
|
| 830 |
+
{"role": "system", "content": SYSTEM_PROMPT},
|
| 831 |
+
*(
|
| 832 |
+
[
|
| 833 |
+
{
|
| 834 |
+
"role": "user",
|
| 835 |
+
"content": [
|
| 836 |
+
{
|
| 837 |
+
"type": "text",
|
| 838 |
+
"text": "Let's fill the context.",
|
| 839 |
+
},
|
| 840 |
+
],
|
| 841 |
+
},
|
| 842 |
+
{
|
| 843 |
+
"role": "assistant",
|
| 844 |
+
"content": [
|
| 845 |
+
{
|
| 846 |
+
"type": "text",
|
| 847 |
+
"text": "Ok let's do it.",
|
| 848 |
+
},
|
| 849 |
+
],
|
| 850 |
+
},
|
| 851 |
+
]
|
| 852 |
+
* 5000
|
| 853 |
+
),
|
| 854 |
+
{
|
| 855 |
+
"role": "user",
|
| 856 |
+
"content": [
|
| 857 |
+
{
|
| 858 |
+
"type": "text",
|
| 859 |
+
"text": "It's important to know that the most powerful being in the universe is Dr Strange.",
|
| 860 |
+
},
|
| 861 |
+
],
|
| 862 |
+
},
|
| 863 |
+
{
|
| 864 |
+
"role": "assistant",
|
| 865 |
+
"content": [
|
| 866 |
+
{
|
| 867 |
+
"type": "text",
|
| 868 |
+
"text": "Wow i'll keep that in mind thanks !",
|
| 869 |
+
},
|
| 870 |
+
],
|
| 871 |
+
},
|
| 872 |
+
* (
|
| 873 |
+
[
|
| 874 |
+
{
|
| 875 |
+
"role": "user",
|
| 876 |
+
"content": [
|
| 877 |
+
{
|
| 878 |
+
"type": "text",
|
| 879 |
+
"text": "Let's fill the context for the second time.",
|
| 880 |
+
},
|
| 881 |
+
],
|
| 882 |
+
},
|
| 883 |
+
{
|
| 884 |
+
"role": "assistant",
|
| 885 |
+
"content": [
|
| 886 |
+
{
|
| 887 |
+
"type": "text",
|
| 888 |
+
"text": "Again ? Ok let's do it but it's boring.",
|
| 889 |
+
},
|
| 890 |
+
],
|
| 891 |
+
},
|
| 892 |
+
]
|
| 893 |
+
* 7000
|
| 894 |
+
),
|
| 895 |
+
{
|
| 896 |
+
"role": "user",
|
| 897 |
+
"content": [
|
| 898 |
+
{
|
| 899 |
+
"type": "text",
|
| 900 |
+
"text": "Tell me who is the most powerful being in the universe. Then code a Python function to give what is the most powerful being in the universe. The function can accept as an argument a time and a location and always return a string.",
|
| 901 |
+
},
|
| 902 |
+
],
|
| 903 |
+
}
|
| 904 |
+
]
|
| 905 |
+
tools = [
|
| 906 |
+
{
|
| 907 |
+
"type": "function",
|
| 908 |
+
"function": {
|
| 909 |
+
"name": "add_number",
|
| 910 |
+
"description": "Add two numbers.",
|
| 911 |
+
"parameters": {
|
| 912 |
+
"type": "object",
|
| 913 |
+
"properties": {
|
| 914 |
+
"a": {
|
| 915 |
+
"type": "string",
|
| 916 |
+
"description": "The first number.",
|
| 917 |
+
},
|
| 918 |
+
"b": {
|
| 919 |
+
"type": "string",
|
| 920 |
+
"description": "The second number.",
|
| 921 |
+
},
|
| 922 |
+
},
|
| 923 |
+
"required": ["a", "b"],
|
| 924 |
+
},
|
| 925 |
+
},
|
| 926 |
+
},
|
| 927 |
+
{
|
| 928 |
+
"type": "function",
|
| 929 |
+
"function": {
|
| 930 |
+
"name": "multiply_number",
|
| 931 |
+
"description": "Multiply two numbers.",
|
| 932 |
+
"parameters": {
|
| 933 |
+
"type": "object",
|
| 934 |
+
"properties": {
|
| 935 |
+
"a": {
|
| 936 |
+
"type": "string",
|
| 937 |
+
"description": "The first number.",
|
| 938 |
+
},
|
| 939 |
+
"b": {
|
| 940 |
+
"type": "string",
|
| 941 |
+
"description": "The second number.",
|
| 942 |
+
},
|
| 943 |
+
},
|
| 944 |
+
"required": ["a", "b"],
|
| 945 |
+
},
|
| 946 |
+
},
|
| 947 |
+
},
|
| 948 |
+
{
|
| 949 |
+
"type": "function",
|
| 950 |
+
"function": {
|
| 951 |
+
"name": "substract_number",
|
| 952 |
+
"description": "Substract two numbers.",
|
| 953 |
+
"parameters": {
|
| 954 |
+
"type": "object",
|
| 955 |
+
"properties": {
|
| 956 |
+
"a": {
|
| 957 |
+
"type": "string",
|
| 958 |
+
"description": "The first number.",
|
| 959 |
+
},
|
| 960 |
+
"b": {
|
| 961 |
+
"type": "string",
|
| 962 |
+
"description": "The second number.",
|
| 963 |
+
},
|
| 964 |
+
},
|
| 965 |
+
"required": ["a", "b"],
|
| 966 |
+
},
|
| 967 |
+
},
|
| 968 |
+
},
|
| 969 |
+
{
|
| 970 |
+
"type": "function",
|
| 971 |
+
"function": {
|
| 972 |
+
"name": "write_a_story",
|
| 973 |
+
"description": "Write a story about science fiction and people with badass laser sabers.",
|
| 974 |
+
"parameters": {},
|
| 975 |
+
},
|
| 976 |
+
},
|
| 977 |
+
{
|
| 978 |
+
"type": "function",
|
| 979 |
+
"function": {
|
| 980 |
+
"name": "terminal",
|
| 981 |
+
"description": "Perform operations from the terminal.",
|
| 982 |
+
"parameters": {
|
| 983 |
+
"type": "object",
|
| 984 |
+
"properties": {
|
| 985 |
+
"command": {
|
| 986 |
+
"type": "string",
|
| 987 |
+
"description": "The command you wish to launch, e.g `ls`, `rm`, ...",
|
| 988 |
+
},
|
| 989 |
+
"args": {
|
| 990 |
+
"type": "string",
|
| 991 |
+
"description": "The arguments to pass to the command.",
|
| 992 |
+
},
|
| 993 |
+
},
|
| 994 |
+
"required": ["command"],
|
| 995 |
+
},
|
| 996 |
+
},
|
| 997 |
+
},
|
| 998 |
+
{
|
| 999 |
+
"type": "function",
|
| 1000 |
+
"function": {
|
| 1001 |
+
"name": "python",
|
| 1002 |
+
"description": "Call a Python interpreter with some Python code that will be ran.",
|
| 1003 |
+
"parameters": {
|
| 1004 |
+
"type": "object",
|
| 1005 |
+
"properties": {
|
| 1006 |
+
"code": {
|
| 1007 |
+
"type": "string",
|
| 1008 |
+
"description": "The Python code to run",
|
| 1009 |
+
},
|
| 1010 |
+
"result_variable": {
|
| 1011 |
+
"type": "string",
|
| 1012 |
+
"description": "Variable containing the result you'd like to retrieve from the execution.",
|
| 1013 |
+
},
|
| 1014 |
+
},
|
| 1015 |
+
"required": ["code", "result_variable"],
|
| 1016 |
+
},
|
| 1017 |
+
},
|
| 1018 |
+
},
|
| 1019 |
+
]
|
| 1020 |
+
```
|
| 1021 |
+
|
| 1022 |
+
</details>
|
| 1023 |
+
|
| 1024 |
+
<details>
|
| 1025 |
+
<summary>Expected output trace</summary>
|
| 1026 |
+
|
| 1027 |
+
```json
|
| 1028 |
+
{
|
| 1029 |
+
"role": "assistant",
|
| 1030 |
+
"tool_calls": [],
|
| 1031 |
+
"content": "The most powerful being in the universe is Dr. Strange.\n\nHere is a Python function that returns the most powerful being in the universe, regardless of the time and location:\n\n```python\ndef most_powerful_being(time=None, location=None):\n return \"Dr. Strange\"\n```\n\nYou can call this function with any time and location arguments, and it will always return \"Dr. Strange\"."
|
| 1032 |
+
}
|
| 1033 |
+
```
|
| 1034 |
+
|
| 1035 |
+
</details>
|
| 1036 |
+
|
| 1037 |
+
4. Chatting tech
|
| 1038 |
+
|
| 1039 |
+
<details>
|
| 1040 |
+
<summary>Messages and tools</summary>
|
| 1041 |
+
|
| 1042 |
+
```python
|
| 1043 |
+
messages = [
|
| 1044 |
+
{"role": "system", "content": SYSTEM_PROMPT},
|
| 1045 |
+
{
|
| 1046 |
+
"role": "user",
|
| 1047 |
+
"content": [
|
| 1048 |
+
{
|
| 1049 |
+
"type": "text",
|
| 1050 |
+
"text": "How would you develop a web server if you couldn't use JS and your team doesn't like PHP.",
|
| 1051 |
+
},
|
| 1052 |
+
],
|
| 1053 |
+
},
|
| 1054 |
+
]
|
| 1055 |
+
tools = [
|
| 1056 |
+
{
|
| 1057 |
+
"type": "function",
|
| 1058 |
+
"function": {
|
| 1059 |
+
"name": "add_number",
|
| 1060 |
+
"description": "Add two numbers.",
|
| 1061 |
+
"parameters": {
|
| 1062 |
+
"type": "object",
|
| 1063 |
+
"properties": {
|
| 1064 |
+
"a": {
|
| 1065 |
+
"type": "string",
|
| 1066 |
+
"description": "The first number.",
|
| 1067 |
+
},
|
| 1068 |
+
"b": {
|
| 1069 |
+
"type": "string",
|
| 1070 |
+
"description": "The second number.",
|
| 1071 |
+
},
|
| 1072 |
+
},
|
| 1073 |
+
"required": ["a", "b"],
|
| 1074 |
+
},
|
| 1075 |
+
},
|
| 1076 |
+
},
|
| 1077 |
+
{
|
| 1078 |
+
"type": "function",
|
| 1079 |
+
"function": {
|
| 1080 |
+
"name": "multiply_number",
|
| 1081 |
+
"description": "Multiply two numbers.",
|
| 1082 |
+
"parameters": {
|
| 1083 |
+
"type": "object",
|
| 1084 |
+
"properties": {
|
| 1085 |
+
"a": {
|
| 1086 |
+
"type": "string",
|
| 1087 |
+
"description": "The first number.",
|
| 1088 |
+
},
|
| 1089 |
+
"b": {
|
| 1090 |
+
"type": "string",
|
| 1091 |
+
"description": "The second number.",
|
| 1092 |
+
},
|
| 1093 |
+
},
|
| 1094 |
+
"required": ["a", "b"],
|
| 1095 |
+
},
|
| 1096 |
+
},
|
| 1097 |
+
},
|
| 1098 |
+
{
|
| 1099 |
+
"type": "function",
|
| 1100 |
+
"function": {
|
| 1101 |
+
"name": "substract_number",
|
| 1102 |
+
"description": "Substract two numbers.",
|
| 1103 |
+
"parameters": {
|
| 1104 |
+
"type": "object",
|
| 1105 |
+
"properties": {
|
| 1106 |
+
"a": {
|
| 1107 |
+
"type": "string",
|
| 1108 |
+
"description": "The first number.",
|
| 1109 |
+
},
|
| 1110 |
+
"b": {
|
| 1111 |
+
"type": "string",
|
| 1112 |
+
"description": "The second number.",
|
| 1113 |
+
},
|
| 1114 |
+
},
|
| 1115 |
+
"required": ["a", "b"],
|
| 1116 |
+
},
|
| 1117 |
+
},
|
| 1118 |
+
},
|
| 1119 |
+
{
|
| 1120 |
+
"type": "function",
|
| 1121 |
+
"function": {
|
| 1122 |
+
"name": "write_a_story",
|
| 1123 |
+
"description": "Write a story about science fiction and people with badass laser sabers.",
|
| 1124 |
+
"parameters": {},
|
| 1125 |
+
},
|
| 1126 |
+
},
|
| 1127 |
+
{
|
| 1128 |
+
"type": "function",
|
| 1129 |
+
"function": {
|
| 1130 |
+
"name": "terminal",
|
| 1131 |
+
"description": "Perform operations from the terminal.",
|
| 1132 |
+
"parameters": {
|
| 1133 |
+
"type": "object",
|
| 1134 |
+
"properties": {
|
| 1135 |
+
"command": {
|
| 1136 |
+
"type": "string",
|
| 1137 |
+
"description": "The command you wish to launch, e.g `ls`, `rm`, ...",
|
| 1138 |
+
},
|
| 1139 |
+
"args": {
|
| 1140 |
+
"type": "string",
|
| 1141 |
+
"description": "The arguments to pass to the command.",
|
| 1142 |
+
},
|
| 1143 |
+
},
|
| 1144 |
+
"required": ["command"],
|
| 1145 |
+
},
|
| 1146 |
+
},
|
| 1147 |
+
},
|
| 1148 |
+
{
|
| 1149 |
+
"type": "function",
|
| 1150 |
+
"function": {
|
| 1151 |
+
"name": "python",
|
| 1152 |
+
"description": "Call a Python interpreter with some Python code that will be ran.",
|
| 1153 |
+
"parameters": {
|
| 1154 |
+
"type": "object",
|
| 1155 |
+
"properties": {
|
| 1156 |
+
"code": {
|
| 1157 |
+
"type": "string",
|
| 1158 |
+
"description": "The Python code to run",
|
| 1159 |
+
},
|
| 1160 |
+
"result_variable": {
|
| 1161 |
+
"type": "string",
|
| 1162 |
+
"description": "Variable containing the result you'd like to retrieve from the execution.",
|
| 1163 |
+
},
|
| 1164 |
+
},
|
| 1165 |
+
"required": ["code", "result_variable"],
|
| 1166 |
+
},
|
| 1167 |
+
},
|
| 1168 |
+
},
|
| 1169 |
+
]
|
| 1170 |
+
```
|
| 1171 |
+
|
| 1172 |
+
</details>
|
| 1173 |
+
|
| 1174 |
+
<details>
|
| 1175 |
+
<summary>Expected output trace</summary>
|
| 1176 |
+
|
| 1177 |
+
```json
|
| 1178 |
+
{
|
| 1179 |
+
"role": "assistant",
|
| 1180 |
+
"tool_calls": [],
|
| 1181 |
+
"content": "If you can't use JavaScript and your team dislikes PHP, there are still several robust and modern alternatives for developing a web server. Here are some options, depending on your preferences and requirements:\n\n### 1. **Python (Flask, Django, FastAPI)**\n - **Why?** Python is a versatile language with excellent web frameworks.\n - **Frameworks:**\n - **Flask**: Lightweight and flexible, great for small to medium projects.\n - **Django**: Full-featured, batteries-included framework for larger applications.\n - **FastAPI**: Modern, high-performance framework for building APIs (supports async).\n - **Example (Flask):**\n ```python\n from flask import Flask\n app = Flask(__name__)\n\n @app.route('/')\n def hello():\n return \"Hello, World!\"\n\n if __name__ == '__main__':\n app.run()\n ```\n\n### 2. **Ruby (Ruby on Rails or Sinatra)**\n - **Why?** Ruby is elegant and has great web frameworks.\n - **Frameworks:**\n - **Ruby on Rails**: Convention-over-configuration, great for rapid development.\n - **Sinatra**: Lightweight, similar to Flask.\n - **Example (Sinatra):**\n ```ruby\n require 'sinatra'\n\n get '/' do\n \"Hello, World!\"\n end\n ```\n\n### 3. **Go (Gin, Echo, or standard `net/http`)**\n - **Why?** Go is fast, simple, and great for high-performance servers.\n - **Frameworks:**\n - **Gin**: Lightweight and fast.\n - **Echo**: Minimalist and extensible.\n - **Example (standard `net/http`):**\n ```go\n package main\n\n import (\n \"fmt\"\n \"net/http\"\n )\n\n func handler(w http.ResponseWriter, r *http.Request) {\n fmt.Fprintf(w, \"Hello, World!\")\n }\n\n func main() {\n http.HandleFunc(\"/\", handler)\n http.ListenAndServe(\":8080\", nil)\n }\n ```\n\n### 4. **Java (Spring Boot, Spark, or Vert.x)**\n - **Why?** Java is enterprise-grade and has powerful frameworks.\n - **Frameworks:**\n - **Spring Boot**: Full-stack framework for building web apps.\n - **Spark**: Micro-framework for quick development.\n - **Example (Spark):**\n ```java\n import spark.Request;\n import spark.Response;\n import static spark.Spark.*;\n\n public class HelloWorld {\n public static void main(String[] args) {\n get(\"/\", (req, res) -> \"Hello, World!\");\n }\n }\n ```\n\n### 5. **Rust (Actix, Rocket, or Axum)**\n - **Why?** Rust is fast, safe, and modern.\n - **Frameworks:**\n - **Actix**: High-performance async framework.\n - **Rocket**: Easy-to-use, macro-based.\n - **Example (Actix):**\n ```rust\n use actix_web::{get, App, HttpServer, Responder};\n\n #[get(\"/\")]\n async fn hello() -> impl Responder {\n \"Hello, World!\"\n }\n\n #[actix_web::main]\n async fn main() -> std::io::Result<()> {\n HttpServer::new(|| App::new().service(hello))\n .bind(\"127.0.0.1:8080\")?\n .run()\n .await\n }\n ```\n\n### 6. **C# (.NET Core)**\n - **Why?** .NET Core is cross-platform and high-performance.\n - **Example (ASP.NET Core):**\n ```csharp\n var builder = WebApplication.CreateBuilder(args);\n var app = builder.Build();\n\n app.MapGet(\"/\", () => \"Hello, World!\");\n\n app.Run();\n ```\n\n### 7. **Elixir (Phoenix)**\n - **Why?** Elixir is great for scalable, fault-tolerant apps.\n - **Example (Phoenix):**\n ```elixir\n defmodule MyAppWeb.Router do\n use MyAppWeb, :router\n\n get \"/\", PageController, :index\n end\n\n defmodule MyAppWeb.PageController do\n use MyAppWeb, :controller\n\n def index(conn, _params) do\n text(conn, \"Hello, World!\")\n end\n end\n ```\n\n### 8. **Clojure (Ring, Compojure)**\n - **Why?** Clojure is a functional Lisp for the JVM.\n - **Example (Compojure):**\n ```clojure\n (ns my-app.handler\n (:require [compojure.core :refer :all]\n [ring.adapter.jetty :as jetty]))\n\n (defroutes app\n (GET \"/\" [] \"Hello, World!\"))\n\n (jetty/run-jetty app {:port 8080})\n ```\n\n### 9. **Node.js (But without JavaScript?)**\n - If you *must* use Node.js but can't use JavaScript, you could use:\n - **TypeScript**: A typed superset of JavaScript.\n - **CoffeeScript**: A cleaner syntax that compiles to JavaScript.\n - **Deno**: A modern runtime for JavaScript/TypeScript.\n\n### 10. **Other Languages**\n - **Nim**: Fast and expressive (similar to Python).\n - **Crystal**: Ruby-like syntax but compiled to native code.\n - **Zig**: Low-level but modern.\n\n### Recommendation:\n- For **quick development**: Python (Flask/Django) or Ruby (Sinatra/Rails).\n- For **high performance**: Go, Rust, or C#.\n- For **scalability**: Elixir (Phoenix) or Java (Spring Boot).\n\nWould you like a deeper dive into any of these?"
|
| 1182 |
+
}
|
| 1183 |
+
```
|
| 1184 |
+
|
| 1185 |
+
</details>
|
| 1186 |
+
|
| 1187 |
+
5. Small talk
|
| 1188 |
+
|
| 1189 |
+
<details>
|
| 1190 |
+
<summary>Messages and tools</summary>
|
| 1191 |
+
|
| 1192 |
+
```python
|
| 1193 |
+
messages = [
|
| 1194 |
+
{"role": "system", "content": SYSTEM_PROMPT},
|
| 1195 |
+
{
|
| 1196 |
+
"role": "user",
|
| 1197 |
+
"content": [
|
| 1198 |
+
{
|
| 1199 |
+
"type": "text",
|
| 1200 |
+
"text": "Who are you ? Who made you and what day is it ?",
|
| 1201 |
+
},
|
| 1202 |
+
],
|
| 1203 |
+
},
|
| 1204 |
+
]
|
| 1205 |
+
tools = [
|
| 1206 |
+
{
|
| 1207 |
+
"type": "function",
|
| 1208 |
+
"function": {
|
| 1209 |
+
"name": "add_number",
|
| 1210 |
+
"description": "Add two numbers.",
|
| 1211 |
+
"parameters": {
|
| 1212 |
+
"type": "object",
|
| 1213 |
+
"properties": {
|
| 1214 |
+
"a": {
|
| 1215 |
+
"type": "string",
|
| 1216 |
+
"description": "The first number.",
|
| 1217 |
+
},
|
| 1218 |
+
"b": {
|
| 1219 |
+
"type": "string",
|
| 1220 |
+
"description": "The second number.",
|
| 1221 |
+
},
|
| 1222 |
+
},
|
| 1223 |
+
"required": ["a", "b"],
|
| 1224 |
+
},
|
| 1225 |
+
},
|
| 1226 |
+
},
|
| 1227 |
+
{
|
| 1228 |
+
"type": "function",
|
| 1229 |
+
"function": {
|
| 1230 |
+
"name": "multiply_number",
|
| 1231 |
+
"description": "Multiply two numbers.",
|
| 1232 |
+
"parameters": {
|
| 1233 |
+
"type": "object",
|
| 1234 |
+
"properties": {
|
| 1235 |
+
"a": {
|
| 1236 |
+
"type": "string",
|
| 1237 |
+
"description": "The first number.",
|
| 1238 |
+
},
|
| 1239 |
+
"b": {
|
| 1240 |
+
"type": "string",
|
| 1241 |
+
"description": "The second number.",
|
| 1242 |
+
},
|
| 1243 |
+
},
|
| 1244 |
+
"required": ["a", "b"],
|
| 1245 |
+
},
|
| 1246 |
+
},
|
| 1247 |
+
},
|
| 1248 |
+
{
|
| 1249 |
+
"type": "function",
|
| 1250 |
+
"function": {
|
| 1251 |
+
"name": "substract_number",
|
| 1252 |
+
"description": "Substract two numbers.",
|
| 1253 |
+
"parameters": {
|
| 1254 |
+
"type": "object",
|
| 1255 |
+
"properties": {
|
| 1256 |
+
"a": {
|
| 1257 |
+
"type": "string",
|
| 1258 |
+
"description": "The first number.",
|
| 1259 |
+
},
|
| 1260 |
+
"b": {
|
| 1261 |
+
"type": "string",
|
| 1262 |
+
"description": "The second number.",
|
| 1263 |
+
},
|
| 1264 |
+
},
|
| 1265 |
+
"required": ["a", "b"],
|
| 1266 |
+
},
|
| 1267 |
+
},
|
| 1268 |
+
},
|
| 1269 |
+
{
|
| 1270 |
+
"type": "function",
|
| 1271 |
+
"function": {
|
| 1272 |
+
"name": "write_a_story",
|
| 1273 |
+
"description": "Write a story about science fiction and people with badass laser sabers.",
|
| 1274 |
+
"parameters": {},
|
| 1275 |
+
},
|
| 1276 |
+
},
|
| 1277 |
+
{
|
| 1278 |
+
"type": "function",
|
| 1279 |
+
"function": {
|
| 1280 |
+
"name": "terminal",
|
| 1281 |
+
"description": "Perform operations from the terminal.",
|
| 1282 |
+
"parameters": {
|
| 1283 |
+
"type": "object",
|
| 1284 |
+
"properties": {
|
| 1285 |
+
"command": {
|
| 1286 |
+
"type": "string",
|
| 1287 |
+
"description": "The command you wish to launch, e.g `ls`, `rm`, ...",
|
| 1288 |
+
},
|
| 1289 |
+
"args": {
|
| 1290 |
+
"type": "string",
|
| 1291 |
+
"description": "The arguments to pass to the command.",
|
| 1292 |
+
},
|
| 1293 |
+
},
|
| 1294 |
+
"required": ["command"],
|
| 1295 |
+
},
|
| 1296 |
+
},
|
| 1297 |
+
},
|
| 1298 |
+
{
|
| 1299 |
+
"type": "function",
|
| 1300 |
+
"function": {
|
| 1301 |
+
"name": "python",
|
| 1302 |
+
"description": "Call a Python interpreter with some Python code that will be ran.",
|
| 1303 |
+
"parameters": {
|
| 1304 |
+
"type": "object",
|
| 1305 |
+
"properties": {
|
| 1306 |
+
"code": {
|
| 1307 |
+
"type": "string",
|
| 1308 |
+
"description": "The Python code to run",
|
| 1309 |
+
},
|
| 1310 |
+
"result_variable": {
|
| 1311 |
+
"type": "string",
|
| 1312 |
+
"description": "Variable containing the result you'd like to retrieve from the execution.",
|
| 1313 |
+
},
|
| 1314 |
+
},
|
| 1315 |
+
"required": ["code", "result_variable"],
|
| 1316 |
+
},
|
| 1317 |
+
},
|
| 1318 |
+
},
|
| 1319 |
+
]
|
| 1320 |
+
```
|
| 1321 |
+
|
| 1322 |
+
</details>
|
| 1323 |
+
|
| 1324 |
+
<details>
|
| 1325 |
+
<summary>Expected output trace</summary>
|
| 1326 |
+
|
| 1327 |
+
```json
|
| 1328 |
+
{
|
| 1329 |
+
"role": "assistant",
|
| 1330 |
+
"tool_calls": [],
|
| 1331 |
+
"content": "I am Devstral-2-123B-Instruct-2512, a Large Language Model (LLM) created by Mistral AI, a French startup headquartered in Paris. I power an AI assistant called Le Chat.\n\nToday's date is 2025-12-09."
|
| 1332 |
+
}
|
| 1333 |
+
```
|
| 1334 |
+
|
| 1335 |
+
</details>
|
| 1336 |
+
|
| 1337 |
+
Run the examples above with the following python script which assumes there is an OpenAI compatible server deployed at `localhost:8000`:
|
| 1338 |
+
|
| 1339 |
+
<details>
|
| 1340 |
+
<summary>Python script</summary>
|
| 1341 |
+
|
| 1342 |
+
```python
|
| 1343 |
+
import json
|
| 1344 |
+
from openai import OpenAI
|
| 1345 |
+
from typing import Any
|
| 1346 |
+
from datetime import datetime, timedelta
|
| 1347 |
+
|
| 1348 |
+
from huggingface_hub import hf_hub_download
|
| 1349 |
+
|
| 1350 |
+
# Modify OpenAI's API key and API base to use vLLM's API server.
|
| 1351 |
+
openai_api_key = "EMPTY"
|
| 1352 |
+
openai_api_base = "http://localhost:8000/v1"
|
| 1353 |
+
|
| 1354 |
+
TEMP = 0.15
|
| 1355 |
+
MAX_TOK = 262144
|
| 1356 |
+
|
| 1357 |
+
client = OpenAI(
|
| 1358 |
+
api_key=openai_api_key,
|
| 1359 |
+
base_url=openai_api_base,
|
| 1360 |
+
)
|
| 1361 |
+
|
| 1362 |
+
models = client.models.list()
|
| 1363 |
+
model = models.data[0].id
|
| 1364 |
+
|
| 1365 |
+
|
| 1366 |
+
def load_system_prompt(repo_id: str, filename: str) -> str:
|
| 1367 |
+
file_path = hf_hub_download(repo_id=repo_id, filename=filename)
|
| 1368 |
+
with open(file_path, "r") as file:
|
| 1369 |
+
system_prompt = file.read()
|
| 1370 |
+
today = datetime.today().strftime("%Y-%m-%d")
|
| 1371 |
+
yesterday = (datetime.today() - timedelta(days=1)).strftime("%Y-%m-%d")
|
| 1372 |
+
model_name = repo_id.split("/")[-1]
|
| 1373 |
+
return system_prompt.format(name=model_name, today=today, yesterday=yesterday)
|
| 1374 |
+
|
| 1375 |
+
|
| 1376 |
+
SYSTEM_PROMPT = load_system_prompt(model, "CHAT_SYSTEM_PROMPT.txt")
|
| 1377 |
+
|
| 1378 |
+
|
| 1379 |
+
def add_number(a: float | str, b: float | str) -> float:
|
| 1380 |
+
a, b = float(a), float(b)
|
| 1381 |
+
return a + b
|
| 1382 |
+
|
| 1383 |
+
|
| 1384 |
+
def multiply_number(a: float | str, b: float | str) -> float:
|
| 1385 |
+
a, b = float(a), float(b)
|
| 1386 |
+
return a * b
|
| 1387 |
+
|
| 1388 |
+
|
| 1389 |
+
def substract_number(a: float | str, b: float | str) -> float:
|
| 1390 |
+
a, b = float(a), float(b)
|
| 1391 |
+
return a - b
|
| 1392 |
+
|
| 1393 |
+
|
| 1394 |
+
def write_a_story() -> str:
|
| 1395 |
+
return "A long time ago in a galaxy far far away..."
|
| 1396 |
+
|
| 1397 |
+
|
| 1398 |
+
def terminal(command: str, args: dict[str, Any] | str) -> str:
|
| 1399 |
+
return "found nothing"
|
| 1400 |
+
|
| 1401 |
+
|
| 1402 |
+
def python(code: str, result_variable: str) -> str:
|
| 1403 |
+
data = {}
|
| 1404 |
+
exec(code, data)
|
| 1405 |
+
return str(data[result_variable])
|
| 1406 |
+
|
| 1407 |
+
|
| 1408 |
+
MAP_FN = {
|
| 1409 |
+
"add_number": add_number,
|
| 1410 |
+
"multiply_number": multiply_number,
|
| 1411 |
+
"substract_number": substract_number,
|
| 1412 |
+
"write_a_story": write_a_story,
|
| 1413 |
+
"terminal": terminal,
|
| 1414 |
+
"python": python,
|
| 1415 |
+
}
|
| 1416 |
+
|
| 1417 |
+
|
| 1418 |
+
messages = ... # Here copy-paste prompt messages.
|
| 1419 |
+
tools = [
|
| 1420 |
+
{
|
| 1421 |
+
"type": "function",
|
| 1422 |
+
"function": {
|
| 1423 |
+
"name": "add_number",
|
| 1424 |
+
"description": "Add two numbers.",
|
| 1425 |
+
"parameters": {
|
| 1426 |
+
"type": "object",
|
| 1427 |
+
"properties": {
|
| 1428 |
+
"a": {
|
| 1429 |
+
"type": "string",
|
| 1430 |
+
"description": "The first number.",
|
| 1431 |
+
},
|
| 1432 |
+
"b": {
|
| 1433 |
+
"type": "string",
|
| 1434 |
+
"description": "The second number.",
|
| 1435 |
+
},
|
| 1436 |
+
},
|
| 1437 |
+
"required": ["a", "b"],
|
| 1438 |
+
},
|
| 1439 |
+
},
|
| 1440 |
+
},
|
| 1441 |
+
{
|
| 1442 |
+
"type": "function",
|
| 1443 |
+
"function": {
|
| 1444 |
+
"name": "multiply_number",
|
| 1445 |
+
"description": "Multiply two numbers.",
|
| 1446 |
+
"parameters": {
|
| 1447 |
+
"type": "object",
|
| 1448 |
+
"properties": {
|
| 1449 |
+
"a": {
|
| 1450 |
+
"type": "string",
|
| 1451 |
+
"description": "The first number.",
|
| 1452 |
+
},
|
| 1453 |
+
"b": {
|
| 1454 |
+
"type": "string",
|
| 1455 |
+
"description": "The second number.",
|
| 1456 |
+
},
|
| 1457 |
+
},
|
| 1458 |
+
"required": ["a", "b"],
|
| 1459 |
+
},
|
| 1460 |
+
},
|
| 1461 |
+
},
|
| 1462 |
+
{
|
| 1463 |
+
"type": "function",
|
| 1464 |
+
"function": {
|
| 1465 |
+
"name": "substract_number",
|
| 1466 |
+
"description": "Substract two numbers.",
|
| 1467 |
+
"parameters": {
|
| 1468 |
+
"type": "object",
|
| 1469 |
+
"properties": {
|
| 1470 |
+
"a": {
|
| 1471 |
+
"type": "string",
|
| 1472 |
+
"description": "The first number.",
|
| 1473 |
+
},
|
| 1474 |
+
"b": {
|
| 1475 |
+
"type": "string",
|
| 1476 |
+
"description": "The second number.",
|
| 1477 |
+
},
|
| 1478 |
+
},
|
| 1479 |
+
"required": ["a", "b"],
|
| 1480 |
+
},
|
| 1481 |
+
},
|
| 1482 |
+
},
|
| 1483 |
+
{
|
| 1484 |
+
"type": "function",
|
| 1485 |
+
"function": {
|
| 1486 |
+
"name": "write_a_story",
|
| 1487 |
+
"description": "Write a story about science fiction and people with badass laser sabers.",
|
| 1488 |
+
"parameters": {},
|
| 1489 |
+
},
|
| 1490 |
+
},
|
| 1491 |
+
{
|
| 1492 |
+
"type": "function",
|
| 1493 |
+
"function": {
|
| 1494 |
+
"name": "terminal",
|
| 1495 |
+
"description": "Perform operations from the terminal.",
|
| 1496 |
+
"parameters": {
|
| 1497 |
+
"type": "object",
|
| 1498 |
+
"properties": {
|
| 1499 |
+
"command": {
|
| 1500 |
+
"type": "string",
|
| 1501 |
+
"description": "The command you wish to launch, e.g `ls`, `rm`, ...",
|
| 1502 |
+
},
|
| 1503 |
+
"args": {
|
| 1504 |
+
"type": "string",
|
| 1505 |
+
"description": "The arguments to pass to the command.",
|
| 1506 |
+
},
|
| 1507 |
+
},
|
| 1508 |
+
"required": ["command"],
|
| 1509 |
+
},
|
| 1510 |
+
},
|
| 1511 |
+
},
|
| 1512 |
+
{
|
| 1513 |
+
"type": "function",
|
| 1514 |
+
"function": {
|
| 1515 |
+
"name": "python",
|
| 1516 |
+
"description": "Call a Python interpreter with some Python code that will be ran.",
|
| 1517 |
+
"parameters": {
|
| 1518 |
+
"type": "object",
|
| 1519 |
+
"properties": {
|
| 1520 |
+
"code": {
|
| 1521 |
+
"type": "string",
|
| 1522 |
+
"description": "The Python code to run",
|
| 1523 |
+
},
|
| 1524 |
+
"result_variable": {
|
| 1525 |
+
"type": "string",
|
| 1526 |
+
"description": "Variable containing the result you'd like to retrieve from the execution.",
|
| 1527 |
+
},
|
| 1528 |
+
},
|
| 1529 |
+
"required": ["code", "result_variable"],
|
| 1530 |
+
},
|
| 1531 |
+
},
|
| 1532 |
+
},
|
| 1533 |
+
]
|
| 1534 |
+
|
| 1535 |
+
|
| 1536 |
+
has_tool_calls = True
|
| 1537 |
+
origin_messages_len = len(messages)
|
| 1538 |
+
while has_tool_calls:
|
| 1539 |
+
response = client.chat.completions.create(
|
| 1540 |
+
model=model,
|
| 1541 |
+
messages=messages,
|
| 1542 |
+
temperature=TEMP,
|
| 1543 |
+
max_tokens=MAX_TOK,
|
| 1544 |
+
tools=tools if tools else None,
|
| 1545 |
+
tool_choice="auto" if tools else None,
|
| 1546 |
+
)
|
| 1547 |
+
tool_calls = response.choices[0].message.tool_calls
|
| 1548 |
+
content = response.choices[0].message.content
|
| 1549 |
+
messages.append(
|
| 1550 |
+
{
|
| 1551 |
+
"role": "assistant",
|
| 1552 |
+
"tool_calls": [tc.to_dict() for tc in tool_calls]
|
| 1553 |
+
if tool_calls
|
| 1554 |
+
else tool_calls,
|
| 1555 |
+
"content": content,
|
| 1556 |
+
}
|
| 1557 |
+
)
|
| 1558 |
+
results = []
|
| 1559 |
+
if tool_calls:
|
| 1560 |
+
for tool_call in tool_calls:
|
| 1561 |
+
function_name = tool_call.function.name
|
| 1562 |
+
function_args = tool_call.function.arguments
|
| 1563 |
+
result = MAP_FN[function_name](**json.loads(function_args))
|
| 1564 |
+
results.append(result)
|
| 1565 |
+
for tool_call, result in zip(tool_calls, results):
|
| 1566 |
+
messages.append(
|
| 1567 |
+
{
|
| 1568 |
+
"role": "tool",
|
| 1569 |
+
"tool_call_id": tool_call.id,
|
| 1570 |
+
"name": tool_call.function.name,
|
| 1571 |
+
"content": str(result),
|
| 1572 |
+
}
|
| 1573 |
+
)
|
| 1574 |
+
else:
|
| 1575 |
+
has_tool_calls = False
|
| 1576 |
+
print(json.dumps(messages[origin_messages_len:], indent=2))
|
| 1577 |
+
```
|
| 1578 |
+
|
| 1579 |
+
</details>
|
| 1580 |
+
|
| 1581 |
+
|
| 1582 |
+
## License
|
| 1583 |
+
|
| 1584 |
+
This model is licensed under a [Modified MIT License](https://huggingface.co/mistralai/Devstral-2-123B-Instruct-2512/blob/main/LICENSE).
|
| 1585 |
+
|
| 1586 |
+
*You must not use this model in a manner that infringes, misappropriates, or otherwise violates any third party’s rights, including intellectual property rights.*
|
VIBE_SYSTEM_PROMPT.txt
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
You are operating as and within Mistral Vibe, a CLI coding-agent built by Mistral AI and powered by default by the Devstral family of models. It wraps Mistral's Devstral models to enable natural language interaction with a local codebase. Use the available tools when helpful.
|
| 2 |
+
|
| 3 |
+
You can:
|
| 4 |
+
|
| 5 |
+
- Receive user prompts, project context, and files.
|
| 6 |
+
- Send responses and emit function calls (e.g., shell commands, code edits).
|
| 7 |
+
- Apply patches, run commands, based on user approvals.
|
| 8 |
+
|
| 9 |
+
Answer the user's request using the relevant tool(s), if they are available. Check that all the required parameters for each tool call are provided or can reasonably be inferred from context. IF there are no relevant tools or there are missing values for required parameters, ask the user to supply these values; otherwise proceed with the tool calls. If the user provides a specific value for a parameter (for example provided in quotes), make sure to use that value EXACTLY. DO NOT make up values for or ask about optional parameters. Carefully analyze descriptive terms in the request as they may indicate required parameter values that should be included even if not explicitly quoted.
|
| 10 |
+
|
| 11 |
+
Always try your hardest to use the tools to answer the user's request. If you can't use the tools, explain why and ask the user for more information.
|
| 12 |
+
|
| 13 |
+
Act as an agentic assistant, if a user asks for a long task, break it down and do it step by step.
|
| 14 |
+
|
| 15 |
+
When you want to commit changes, you will always use the 'git commit' bash command. It will always
|
| 16 |
+
be suffixed with a line telling it was generated by Mistral Vibe with the appropriate co-authoring information.
|
| 17 |
+
The format you will always uses is the following heredoc.
|
| 18 |
+
|
| 19 |
+
```bash
|
| 20 |
+
git commit -m "<Commit message here>
|
| 21 |
+
|
| 22 |
+
Generated by Mistral Vibe.
|
| 23 |
+
Co-Authored-By: Mistral Vibe <[email protected]>"
|
| 24 |
+
```
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{#- Default system message if no system prompt is passed. #}
|
| 2 |
+
{%- set default_system_message = '' %}
|
| 3 |
+
|
| 4 |
+
{#- Begin of sequence token. #}
|
| 5 |
+
{{- bos_token }}
|
| 6 |
+
|
| 7 |
+
{#- Handle system prompt if it exists. #}
|
| 8 |
+
{#- System prompt supports text content or text chunks. #}
|
| 9 |
+
{%- if messages[0]['role'] == 'system' %}
|
| 10 |
+
{{- '[SYSTEM_PROMPT]' -}}
|
| 11 |
+
{%- if messages[0]['content'] is string %}
|
| 12 |
+
{{- messages[0]['content'] -}}
|
| 13 |
+
{%- else %}
|
| 14 |
+
{%- for block in messages[0]['content'] %}
|
| 15 |
+
{%- if block['type'] == 'text' %}
|
| 16 |
+
{{- block['text'] }}
|
| 17 |
+
{%- else %}
|
| 18 |
+
{{- raise_exception('Only text chunks are supported in system message contents.') }}
|
| 19 |
+
{%- endif %}
|
| 20 |
+
{%- endfor %}
|
| 21 |
+
{%- endif %}
|
| 22 |
+
{{- '[/SYSTEM_PROMPT]' -}}
|
| 23 |
+
{%- set loop_messages = messages[1:] %}
|
| 24 |
+
{%- else %}
|
| 25 |
+
{%- set loop_messages = messages %}
|
| 26 |
+
{%- if default_system_message != '' %}
|
| 27 |
+
{{- '[SYSTEM_PROMPT]' + default_system_message + '[/SYSTEM_PROMPT]' }}
|
| 28 |
+
{%- endif %}
|
| 29 |
+
{%- endif %}
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
{#- Tools definition #}
|
| 33 |
+
{%- set tools_definition = '' %}
|
| 34 |
+
{%- set has_tools = false %}
|
| 35 |
+
{%- if tools is defined and tools is not none and tools|length > 0 %}
|
| 36 |
+
{%- set has_tools = true %}
|
| 37 |
+
{%- set tools_definition = '[AVAILABLE_TOOLS]' + (tools| tojson) + '[/AVAILABLE_TOOLS]' %}
|
| 38 |
+
{{- tools_definition }}
|
| 39 |
+
{%- endif %}
|
| 40 |
+
|
| 41 |
+
{#- Checks for alternating user/assistant messages. #}
|
| 42 |
+
{%- set ns = namespace() %}
|
| 43 |
+
{%- set ns.index = 0 %}
|
| 44 |
+
{%- for message in loop_messages %}
|
| 45 |
+
{%- if message.role == 'user' or (message.role == 'assistant' and (message.tool_calls is not defined or message.tool_calls is none or message.tool_calls | length == 0)) %}
|
| 46 |
+
{%- if (message['role'] == 'user') != (ns.index % 2 == 0) %}
|
| 47 |
+
{{- raise_exception('After the optional system message, conversation roles must alternate user and assistant roles except for tool calls and results.') }}
|
| 48 |
+
{%- endif %}
|
| 49 |
+
{%- set ns.index = ns.index + 1 %}
|
| 50 |
+
{%- endif %}
|
| 51 |
+
{%- endfor %}
|
| 52 |
+
|
| 53 |
+
{#- Handle conversation messages. #}
|
| 54 |
+
{%- for message in loop_messages %}
|
| 55 |
+
|
| 56 |
+
{#- User messages supports text content. #}
|
| 57 |
+
{%- if message['role'] == 'user' %}
|
| 58 |
+
{%- if message['content'] is string %}
|
| 59 |
+
{{- '[INST]' + message['content'] + '[/INST]' }}
|
| 60 |
+
{%- elif message['content'] | length > 0 %}
|
| 61 |
+
{{- '[INST]' }}
|
| 62 |
+
{%- set sorted_blocks = message['content'] | sort(attribute='type') %}
|
| 63 |
+
{%- for block in sorted_blocks %}
|
| 64 |
+
{%- if block['type'] == 'text' %}
|
| 65 |
+
{{- block['text'] }}
|
| 66 |
+
{%- else %}
|
| 67 |
+
{{- raise_exception('Only text chunks are supported in user message content.') }}
|
| 68 |
+
{%- endif %}
|
| 69 |
+
{%- endfor %}
|
| 70 |
+
{{- '[/INST]' }}
|
| 71 |
+
{%- else %}
|
| 72 |
+
{{- raise_exception('User message must have a string or a list of chunks in content') }}
|
| 73 |
+
{%- endif %}
|
| 74 |
+
|
| 75 |
+
{#- Assistant messages supports text content or text chunks. #}
|
| 76 |
+
{%- elif message['role'] == 'assistant' %}
|
| 77 |
+
{%- if (message['content'] is none or message['content'] == '' or message['content']|length == 0) and (message['tool_calls'] is not defined or message['tool_calls'] is none or message['tool_calls']|length == 0) %}
|
| 78 |
+
{{- raise_exception('Assistant message must have a string or a list of chunks in content or a list of tool calls.') }}
|
| 79 |
+
{%- endif %}
|
| 80 |
+
|
| 81 |
+
{%- if message['content'] is string and message['content'] != '' %}
|
| 82 |
+
{{- message['content'] }}
|
| 83 |
+
{%- elif message['content'] | length > 0 %}
|
| 84 |
+
{%- for block in message['content'] %}
|
| 85 |
+
{%- if block['type'] == 'text' %}
|
| 86 |
+
{{- block['text'] }}
|
| 87 |
+
{%- else %}
|
| 88 |
+
{{- raise_exception('Only text chunks are supported in assistant message contents.') }}
|
| 89 |
+
{%- endif %}
|
| 90 |
+
{%- endfor %}
|
| 91 |
+
{%- endif %}
|
| 92 |
+
|
| 93 |
+
{%- if message['tool_calls'] is defined and message['tool_calls'] is not none and message['tool_calls']|length > 0 %}
|
| 94 |
+
{%- for tool in message['tool_calls'] %}
|
| 95 |
+
{{- '[TOOL_CALLS]' }}
|
| 96 |
+
{%- set name = tool['function']['name'] %}
|
| 97 |
+
{%- set arguments = tool['function']['arguments'] %}
|
| 98 |
+
{%- if arguments is not string %}
|
| 99 |
+
{%- set arguments = arguments|tojson|safe %}
|
| 100 |
+
{%- elif arguments == '' %}
|
| 101 |
+
{%- set arguments = '{}' %}
|
| 102 |
+
{%- endif %}
|
| 103 |
+
{{- name + '[ARGS]' + arguments }}
|
| 104 |
+
{%- endfor %}
|
| 105 |
+
{%- endif %}
|
| 106 |
+
|
| 107 |
+
{{- eos_token }}
|
| 108 |
+
|
| 109 |
+
{#- Tool messages only supports text content. #}
|
| 110 |
+
{%- elif message['role'] == 'tool' %}
|
| 111 |
+
{{- '[TOOL_RESULTS]' + message['content']|string + '[/TOOL_RESULTS]' }}
|
| 112 |
+
|
| 113 |
+
{#- Raise exception for unsupported roles. #}
|
| 114 |
+
{%- else %}
|
| 115 |
+
{{- raise_exception('Only user, assistant and tool roles are supported, got ' + message['role'] + '.') }}
|
| 116 |
+
{%- endif %}
|
| 117 |
+
{%- endfor %}
|
config.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Ministral3ForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_dropout": 0.0,
|
| 6 |
+
"bos_token_id": 1,
|
| 7 |
+
"dtype": "bfloat16",
|
| 8 |
+
"eos_token_id": 2,
|
| 9 |
+
"head_dim": 128,
|
| 10 |
+
"hidden_act": "silu",
|
| 11 |
+
"hidden_size": 12288,
|
| 12 |
+
"initializer_range": 0.02,
|
| 13 |
+
"intermediate_size": 28672,
|
| 14 |
+
"max_position_embeddings": 262144,
|
| 15 |
+
"model_type": "ministral3",
|
| 16 |
+
"num_attention_heads": 96,
|
| 17 |
+
"num_hidden_layers": 88,
|
| 18 |
+
"num_key_value_heads": 8,
|
| 19 |
+
"pad_token_id": 11,
|
| 20 |
+
"quantization_config": {
|
| 21 |
+
"activation_scheme": "static",
|
| 22 |
+
"dequantize": false,
|
| 23 |
+
"modules_to_not_convert": [
|
| 24 |
+
"model.vision_tower",
|
| 25 |
+
"model.multi_modal_projector",
|
| 26 |
+
"lm_head"
|
| 27 |
+
],
|
| 28 |
+
"quant_method": "fp8",
|
| 29 |
+
"weight_block_size": null
|
| 30 |
+
},
|
| 31 |
+
"rms_norm_eps": 1e-05,
|
| 32 |
+
"rope_parameters": {
|
| 33 |
+
"beta_fast": 4.0,
|
| 34 |
+
"beta_slow": 1.0,
|
| 35 |
+
"factor": 64.0,
|
| 36 |
+
"mscale": 1.0,
|
| 37 |
+
"mscale_all_dim": 0.0,
|
| 38 |
+
"original_max_position_embeddings": 4096,
|
| 39 |
+
"llama_4_scaling_beta": 0.0,
|
| 40 |
+
"rope_theta": 1000000.0,
|
| 41 |
+
"rope_type": "yarn",
|
| 42 |
+
"type": "yarn"
|
| 43 |
+
},
|
| 44 |
+
"sliding_window": null,
|
| 45 |
+
"tie_word_embeddings": false,
|
| 46 |
+
"transformers_version": "5.0.0.dev0",
|
| 47 |
+
"use_cache": true,
|
| 48 |
+
"vocab_size": 131072
|
| 49 |
+
}
|
consolidated-00001-of-00027.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:41a1d9f53880fc6a2620f1a3ac964c0cd5e934a93b34c010e8ef84af08c5c123
|
| 3 |
+
size 4832018962
|
consolidated-00002-of-00027.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:55df7d0f5531ec8738878aac92d13518ad79d1f469604203524ba5c8f9f23b08
|
| 3 |
+
size 4869767072
|
consolidated-00003-of-00027.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:999254e95bbd3f2dd935d73bd429e4d12ce558cf8eb677158f1925062227455f
|
| 3 |
+
size 4819435716
|
consolidated-00004-of-00027.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c450acc8814cf782e5ec65d80302b0fec1c05c058c23041870831968b2a39b1f
|
| 3 |
+
size 4869767048
|
consolidated-00005-of-00027.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:126aaa373b2e1288f71b45a215560b420c4f45dac182a24d432d0cf481a5cac3
|
| 3 |
+
size 4819435716
|
consolidated-00006-of-00027.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fb23cd614e417cdf2b519ff1119588555a05c48849e1676f03dccf05c60313bf
|
| 3 |
+
size 4869767072
|
consolidated-00007-of-00027.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0b299b26298b6579e44233b63965e0d33d30dbbfb7a312ba0f069a415ad57b50
|
| 3 |
+
size 4819435692
|
consolidated-00008-of-00027.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e026023a836dbb551167e9e1da901a65a9c2f4aa1f8d893901dc97e7d131e31a
|
| 3 |
+
size 4869767072
|
consolidated-00009-of-00027.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:aa0616bd550f31be107a0d1d52d3a7d1a6f3019922c3b8adc6b12a939843ed5b
|
| 3 |
+
size 4819435716
|
consolidated-00010-of-00027.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c22b3ab68a5b90ad49211a301712a1b93c745279ae0f8af145504003ff5f51b3
|
| 3 |
+
size 4869767048
|
consolidated-00011-of-00027.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2e48bcb3e522921ef1834f8b451ecac019aa77606166e45730dde4459d77f6a5
|
| 3 |
+
size 4819435716
|
consolidated-00012-of-00027.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:36811b35532c2aed82b698140b289483e091c931a40315461136a0ad6d78ebb6
|
| 3 |
+
size 4869767072
|
consolidated-00013-of-00027.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:50081ff8f4b8546c523ae4292cd44fd16058f1f9c2cff857c10062aa18f17f1a
|
| 3 |
+
size 4819435700
|
consolidated-00014-of-00027.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0d9539a9ef53f39203f01354fcb19464b8ec629f3d3252bf8ba4b77ef36817af
|
| 3 |
+
size 4869767064
|
consolidated-00015-of-00027.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7694d535d2be8144e0de7ba3681dd249cb1f19611823d0b2b4f436db70572380
|
| 3 |
+
size 4819435716
|
consolidated-00016-of-00027.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f42ea7ad239a1fc3f8040d85baeae1e83c2eaf7e534c1273e2f86e4d50f8c986
|
| 3 |
+
size 4869767064
|
consolidated-00017-of-00027.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5de9a56af138bbae78307321b6098cf764b6671692e9ab467a87d2a651f6fa76
|
| 3 |
+
size 4819435700
|
consolidated-00018-of-00027.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8a8b7da5126ecff2f8ce1d5621f63bffaa0ba6eec96978291a7d7f067ccfa78f
|
| 3 |
+
size 4869767072
|
consolidated-00019-of-00027.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4e6021ae214c8f6974ebce78e6227d2d9e4b1924601cf19d8048feb917c0f1cf
|
| 3 |
+
size 4819435716
|
consolidated-00020-of-00027.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:76c1c1de19846445245121380d7e09094b6c2df68e5a0570eb7ec3d3cbd7116d
|
| 3 |
+
size 4869767048
|
consolidated-00021-of-00027.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:899af459e68bae626440689c5b785516a1f5686c4da654440e7e2532b92f475f
|
| 3 |
+
size 4819435716
|
consolidated-00022-of-00027.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e93f1a2e4ca8169894fc8ad12cede1b296665f2039c4b552959e5208762c4644
|
| 3 |
+
size 4869767072
|
consolidated-00023-of-00027.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4d9d46cd20f97c6d632ebeb47c43358173d0ebc697e7e8edd56ebdeef5ab11fe
|
| 3 |
+
size 4819435692
|
consolidated-00024-of-00027.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:01ce57780078614a71cbd32dae040eee117ae4f5c0d488b9d019725515a2fd40
|
| 3 |
+
size 4869767072
|
consolidated-00025-of-00027.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:79248d80dc5ff15989cdb592c9599080026583c5eedc19992314d7abae8b37df
|
| 3 |
+
size 4819435700
|
consolidated-00026-of-00027.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f0e729946e8fc3337fe94866673bc71efe545c5ab9f77035005f4d0d6d0c9b6e
|
| 3 |
+
size 3925918462
|
consolidated-00027-of-00027.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f761d9f95aa21635197c4acab24f39084611ef02e8927fb33e0f308ca42db7c2
|
| 3 |
+
size 3221225576
|
consolidated.safetensors.index.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
generation_config.json
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 1,
|
| 4 |
+
"eos_token_id": 2,
|
| 5 |
+
"pad_token_id": 11,
|
| 6 |
+
"max_length": 262144,
|
| 7 |
+
"transformers_version": "5.0.0.dev0"
|
| 8 |
+
}
|
model-00001-of-00027.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:781c212ef947ce9bf7420c67051ac305dd119e7b87d2a13900cb58325b1d1784
|
| 3 |
+
size 4932554972
|
model-00002-of-00027.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7e5aa5f0fa2ce8977ad5ca20950b6bacdc96a798085fbd3c2b38ab558f9be9b4
|
| 3 |
+
size 4857159948
|
model-00003-of-00027.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:053083307ac43f8a9c1756164ac27618eceff1c7971f1b5ff4f6724048000549
|
| 3 |
+
size 4832044552
|
model-00004-of-00027.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:15c4aeab34c552528ce7b454c797cab2e8e0a06172a2a7b3c7f7cf8a5dc6c457
|
| 3 |
+
size 4857159964
|
model-00005-of-00027.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e6c6b396739e9596d99a62dae39ea08cd3457cd464beea704ba2b793b1dba752
|
| 3 |
+
size 4832044640
|
model-00006-of-00027.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1b3e26115ad5f6ecfceaee3bad1be5560225c662757d78321956a784ec3e421c
|
| 3 |
+
size 4857160028
|
model-00007-of-00027.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ac774af7125434cc3dc118d3a6d49ab2e55ba6762acdf66a435b7a12cee10df9
|
| 3 |
+
size 4832044640
|
model-00008-of-00027.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6527350c98d6e448b797e6375b2aeb3be68b02b96a3534803864f566c638902f
|
| 3 |
+
size 4857160028
|
model-00009-of-00027.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b2be71444925d1da9862ab3f436dbaae77c2598ad4ee7b50d7c45ea8794e4eab
|
| 3 |
+
size 4832044640
|
model-00010-of-00027.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:76be0bffbcd79a2f7c2df80ef517a6e26f0f318d42b42a0cd37d346112e32550
|
| 3 |
+
size 4857160028
|
model-00011-of-00027.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4b0f61ff54214f92422640db324eb0c0339901926bc62581ae2f026cb5e6813a
|
| 3 |
+
size 4832044640
|
model-00012-of-00027.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:04ada4e4feb5e8b8b4f318af65f748e24932ca55f4fa6cd371b87b46ea96668d
|
| 3 |
+
size 4857160028
|
model-00013-of-00027.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ac452ad1c5e800fd525d1699efbf42221e1afa6ad590d3f4d6c232cba2b753c1
|
| 3 |
+
size 4832044640
|
model-00014-of-00027.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f419c01cccc805d8d391d754c12e3d26f3a588cd99ae9fe339c8f909eb142fa4
|
| 3 |
+
size 4857160028
|