Instructions to use roskosmos19/Dolphin-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use roskosmos19/Dolphin-4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="roskosmos19/Dolphin-4B", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("roskosmos19/Dolphin-4B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use roskosmos19/Dolphin-4B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "roskosmos19/Dolphin-4B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "roskosmos19/Dolphin-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/roskosmos19/Dolphin-4B
- SGLang
How to use roskosmos19/Dolphin-4B 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 "roskosmos19/Dolphin-4B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "roskosmos19/Dolphin-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "roskosmos19/Dolphin-4B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "roskosmos19/Dolphin-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use roskosmos19/Dolphin-4B with Docker Model Runner:
docker model run hf.co/roskosmos19/Dolphin-4B
Dolphin-4B
Dolphin is a highly capable, efficient, and practical language model focused on maximum usefulness, strong reasoning, excellent coding ability, and reliable agentic behavior.
This is a carefully configured and optimized release based on the Spark-X2.5-4B architecture, fine-tuned in identity and behavior to deliver elite-level performance in everyday use, coding, tool use, and complex tasks.
Key Strengths
- Extremely helpful & truthful – Clear, accurate, and direct answers. Never invents facts.
- Strong reasoning – Careful step-by-step thinking, especially on hard problems.
- Excellent coding – Clean, modern, production-ready code with good explanations.
- Agent-ready – Solid tool calling, multi-step workflows, and instruction following.
- Long context – Native support for up to 1M tokens via hybrid sliding-window + full attention architecture.
- Efficient – Optimized for speed and low memory usage compared to many models of similar capability.
Model Details
| Property | Value |
|---|---|
| Parameters | ~4.1B |
| Context Length | 1,048,576 tokens |
| Architecture | Hybrid Attention (Sliding Window + Full) |
| Vocabulary Size | 131,072 |
| Precision | bfloat16 |
| License | Apache 2.0 |
Recommended Sampling Parameters
{
"temperature": 1.0,
"top_p": 0.95,
"top_k": -1,
"repetition_penalty": 1.0,
"presence_penalty": 0.0,
"frequency_penalty": 0.0
}
These settings work particularly well with the built-in thinking mode.
System Prompt (Default)
Dolphin comes with a strong default system prompt focused on:
- Maximum helpfulness and truthfulness
- Careful reasoning
- Clean coding practices
- Clear and structured communication
- Professional yet friendly tone
You can still override it with your own system message.
Quick Start
Transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "path/to/Dolphin-X2.5-4B"
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype="bfloat16",
device_map="auto",
trust_remote_code=True
)
messages = [
{"role": "user", "content": "Write a clean Python function that calculates the Fibonacci sequence up to n."}
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=1024, temperature=1.0, top_p=0.95)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
vLLM / SGLang / Ollama / LM Studio
The model is fully compatible with the same inference stacks as the original Spark-X2.5 architecture (vLLM, SGLang, llama.cpp, MLX, Ollama, LM Studio, etc.).
Use the included chat template and the recommended sampling parameters above for best results.
Chat Template
The model uses a clean, modern chat template with support for:
- System / User / Assistant roles
- Thinking mode (
<think>...</think>) - Tool calling
- Multi-turn conversations
Thinking is enabled by default. You can disable it per request if desired.
Philosophy
Dolphin is built with one clear goal:
Be as useful, accurate, and high-quality as possible in real-world use.
No fluff. No unnecessary restrictions. Just strong, reliable performance.
License
Apache 2.0
Credits
Based on the excellent Spark-X2.5 architecture and training work by the SparkLLM / XHToken team.
- Downloads last month
- 174
Model tree for roskosmos19/Dolphin-4B
Base model
XHToken/Spark-X2.5-4B-Base