Text Generation
Transformers
Safetensors
English
Chinese
function-calling
tool-use
crypto
blockchain
solana
ethereum
on-device
privacy
edge-ai
mobile
wallet
standard-protocol
Instructions to use DMindAI/DMind-3-nano with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use DMindAI/DMind-3-nano with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="DMindAI/DMind-3-nano")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("DMindAI/DMind-3-nano", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use DMindAI/DMind-3-nano with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "DMindAI/DMind-3-nano" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "DMindAI/DMind-3-nano", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/DMindAI/DMind-3-nano
- SGLang
How to use DMindAI/DMind-3-nano with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "DMindAI/DMind-3-nano" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "DMindAI/DMind-3-nano", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "DMindAI/DMind-3-nano" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "DMindAI/DMind-3-nano", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use DMindAI/DMind-3-nano with Docker Model Runner:
docker model run hf.co/DMindAI/DMind-3-nano
Add usage principles for developer prompt
Browse files- Add usage principles section with clear rules
- Emphasize placing developer prompt only once at session start
- Clarify not to include in user/assistant messages
- Provide correct usage pattern example
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
README.md
CHANGED
|
@@ -235,6 +235,29 @@ User: "Search for SOL on Solana" Model:
|
|
| 235 |
|
| 236 |
For optimal performance, use the following developer/system prompt when initializing the model:
|
| 237 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 238 |
```json
|
| 239 |
{
|
| 240 |
"messages": [
|
|
|
|
| 235 |
|
| 236 |
For optimal performance, use the following developer/system prompt when initializing the model:
|
| 237 |
|
| 238 |
+
### Usage Principles (Important)
|
| 239 |
+
|
| 240 |
+
**Follow these rules for best results:**
|
| 241 |
+
|
| 242 |
+
1. **Place Once at the Beginning**: Put the developer prompt only once, at the very start of your conversation session
|
| 243 |
+
2. **Do NOT place in user messages**: Never include the developer prompt content in user/assistant messages or tool schemas
|
| 244 |
+
3. **Session-wide persistence**: For multi-turn conversations, keep the same developer prompt at the session start - do not repeat it
|
| 245 |
+
|
| 246 |
+
**Correct usage pattern:**
|
| 247 |
+
```json
|
| 248 |
+
{
|
| 249 |
+
"messages": [
|
| 250 |
+
{"role": "developer", "content": "<developer prompt goes here>"},
|
| 251 |
+
{"role": "user", "content": "first user query"},
|
| 252 |
+
{"role": "assistant", "content": "assistant response"},
|
| 253 |
+
{"role": "user", "content": "second user query"}
|
| 254 |
+
// No need to repeat developer prompt in subsequent turns
|
| 255 |
+
]
|
| 256 |
+
}
|
| 257 |
+
```
|
| 258 |
+
|
| 259 |
+
### Developer Prompt Content
|
| 260 |
+
|
| 261 |
```json
|
| 262 |
{
|
| 263 |
"messages": [
|