3X Your Interview Chances
AI Resume Builder
Import LinkedIn, get AI suggestions, land more interviews
4 min to read
Devstral, Mistral AI’s cutting-edge agentic coding model, is redefining the boundaries of automated software engineering. Whether you’re a hobbyist developer, a seasoned enterprise engineer, or a research scientist, Devstral offers unprecedented capabilities that streamline and scale complex coding workflows.
Devstral is a high-performance, open-source agentic coding large language model (LLM) developed by Mistral AI in collaboration with All Hands AI. It is engineered specifically for real-world software engineering tasks and fine-tuned to excel at:
Built on the Mistral Small 3.1 architecture, Devstral features a 128k context window, allowing it to consume and reason about extensive documentation and multi-file codebases. It is a text-only model, with the vision encoder removed to optimize for code-centric tasks.
Minimum Hardware:
Software:
Create a Python virtual environment using Anaconda:
conda create -n devstral python=3.10
conda activate devstral
Install required packages:
pip install mistral_inference --upgrade
pip install huggingface_hub
Use Hugging Face to fetch the model:
from huggingface_hub import snapshot_download
from pathlib import Path
mistral_models_path = Path.home().joinpath('mistral_models', 'Devstral')
mistral_models_path.mkdir(parents=True, exist_ok=True)
snapshot_download(
repo_id="mistralai/Devstral-Small-2505",
allow_patterns=["params.json", "consolidated.safetensors", "tekken.json"],
local_dir=mistral_models_path
)
mistral-chat $HOME/mistral_models/Devstral --instruct --max_tokens 300
Test with a prompt like:
Create a REST API from scratch using Python.
vllm serve mistralai/Devstral-Small-2505 \
--tokenizer_mode mistral \
--config_format mistral \
--load_format mistral \
--tool-call-parser mistral \
--enable-auto-tool-choice \
--tensor-parallel-size 2
Performance Tuning Tips:
--threads
and --ctx-size
up to 128k--n-gpu-layers
Options include NodeShift, AWS, GCP, and Azure. NodeShift is particularly affordable and user-friendly.
Recommended:
Follow local setup steps. Use VS Code Remote-SSH for development.
Create full-stack apps (like an RGB Color Mixer) using Devstral. It generates complete HTML, CSS, and JS, ready to deploy.
OpenHands is a robust automation platform that connects with Devstral for agentic coding.
Sign up on the Mistral AI platform and fund your account ($5 minimum).
export MISTRAL_API_KEY=<YOUR_KEY>
docker pull docker.all-hands.dev/all-hands-ai/runtime:0.39-nikolaik
mkdir -p ~/.openhands-state
cat << EOF > ~/.openhands-state/settings.json
{
"language": "en",
"agent": "CodeActAgent",
"llm_model": "mistral/devstral-small-2505",
"llm_api_key": "${MISTRAL_API_KEY}",
"enable_default_condenser": true
}
EOF
docker run -it --rm --pull=always \
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.39-nikolaik \
-e LOG_ALL_EVENTS=true \
-v /var/run/docker.sock:/var/run/docker.sock \
-v ~/.openhands-state:/.openhands-state \
-p 3000:3000 \
--add-host host.docker.internal:host-gateway \
--name openhands-app \
--memory="4g" \
--cpus="2" \
docker.all-hands.dev/all-hands-ai/openhands:0.39
Use the web UI or API to delegate coding tasks—Devstral handles them autonomously.
Steps:
unsloth
and llama.cpp
Use system-level prompts (like SYSTEM_PROMPT.txt
) to guide Devstral’s behavior for specific tasks:
Devstral shines in real-world development:
mistral-common
and huggingface_hub
updatedDevstral by Mistral AI is a revolutionary leap in coding automation—offering a robust, open-source solution for developers who demand more than just code completion.
With support for agentic reasoning, multi-step workflows, and massive codebases, it’s positioned to become a cornerstone of future development stacks.
Need expert guidance? Connect with a top Codersera professional today!