Dolphin-4B

Korrektur / Correction (2026-11-23)

DE: Die Gewichte in diesem Repo sind Byte für Byte identisch mit XHToken/Spark-X2.5-4B (SHA-256 der Safetensors-Dateien verglichen). Geändert wurden nur Konfiguration, Chat-Template bzw. Doku. Aussagen über zusätzliches Training oder bessere Benchmark-Werte beziehen sich daher nicht auf andere Gewichte als das Original.

EN: The weights in this repo are byte-identical to XHToken/Spark-X2.5-4B (SHA-256 of the safetensors files compared). Only configuration, chat template and/or documentation were changed. Claims about additional training or improved benchmark scores therefore do not refer to weights that differ from the original.

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. Aims to avoid inventing 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 = "roskosmos19/Dolphin-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.

Intended use

  • General assistant, coding, reasoning, and agentic / tool-use experiments.

Limitations

  • Can hallucinate or produce wrong answers and code; verify outputs before relying on them.
  • No own benchmark evaluation was run for this repo; see the base model's card for measured scores.
  • Inherits the limitations and biases of the base model and its training data.
  • Requires trust_remote_code=True; review modeling_spark.py and configuration_spark.py before running.
  • Very long contexts need a lot of GPU memory.

License

Apache 2.0

Credits

Based on the excellent Spark-X2.5 architecture and training work by the SparkLLM / XHToken team.

Downloads last month
67
Safetensors
Model size
4B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for roskosmos19/Dolphin-4B

Finetuned
(29)
this model