Instructions to use danish-foundation-models/DFM-Mimir-v1.8-Mini with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use danish-foundation-models/DFM-Mimir-v1.8-Mini with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="danish-foundation-models/DFM-Mimir-v1.8-Mini") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("danish-foundation-models/DFM-Mimir-v1.8-Mini") model = AutoModelForCausalLM.from_pretrained("danish-foundation-models/DFM-Mimir-v1.8-Mini", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use danish-foundation-models/DFM-Mimir-v1.8-Mini with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "danish-foundation-models/DFM-Mimir-v1.8-Mini" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "danish-foundation-models/DFM-Mimir-v1.8-Mini", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/danish-foundation-models/DFM-Mimir-v1.8-Mini
- SGLang
How to use danish-foundation-models/DFM-Mimir-v1.8-Mini 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 "danish-foundation-models/DFM-Mimir-v1.8-Mini" \ --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": "danish-foundation-models/DFM-Mimir-v1.8-Mini", "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 "danish-foundation-models/DFM-Mimir-v1.8-Mini" \ --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": "danish-foundation-models/DFM-Mimir-v1.8-Mini", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use danish-foundation-models/DFM-Mimir-v1.8-Mini with Docker Model Runner:
docker model run hf.co/danish-foundation-models/DFM-Mimir-v1.8-Mini
DFM-Mimir-v1.8-Mini
This release contains the B final epoch-3 EMA checkpoint at step 1,538,766, with 703,595,520 total parameters, exported as BF16 inference weights. The historical evaluation directory used the planned step 1538769; the actual released checkpoint is 1538766.
Architecture and training
HRM-Text uses hierarchical recurrent computation and a PrefixLM objective. The configuration records the exact architecture: H=2, L=3, a 262,144-token vocabulary and a 4,096-token default context. The model uses the full Gemma tokenizer with native chat rendering and thinking disabled. Mini does not use the separate 65,536-token experimental Mini tokenizer.
The final training mixture is DFM15 (MTC v1.8). Training combines public sources with agreement-backed DBC/Lex.dk material; public downloads alone are not sufficient to reconstruct that material. Architecture and training sources are documented in HRM-Text and Mimir. The weight license is Apache-2.0; tokenizer origins and applicable upstream terms remain relevant independently of the weight license.
Loading and serving
These weights require an HRM-aware runtime with PrefixLM support. The evaluated environment used Transformers 5.17.0 and vLLM 0.31.0 with HRM-specific support. Version numbers alone do not establish equivalence: do not assume an unmodified installation supports this architecture. See the Mimir repository for the HRM runtime implementation and installation. This repository does not provide an automatic remote-code loader.
After installing a compatible HRM runtime, download this repository to
./DFM-Mimir-v1.8-Mini and run the following evaluation-style server command:
python -m vllm.entrypoints.openai.api_server \
--model ./DFM-Mimir-v1.8-Mini \
--tokenizer ./DFM-Mimir-v1.8-Mini \
--served-model-name danish-foundation-models/DFM-Mimir-v1.8-Mini \
--chat-template ./DFM-Mimir-v1.8-Mini/chat_template.jinja \
--host 127.0.0.1 --port 8200 \
--tensor-parallel-size 1 --gpu-memory-utilization 0.95 \
--attention-backend FLASH_ATTN \
--max-model-len 8192 --max-num-seqs 64 --max-num-batched-tokens 8192 \
--no-enable-prefix-caching --no-enable-chunked-prefill --enforce-eager \
--default-chat-template-kwargs '{"enable_thinking":false}' \
--hf-overrides '{"max_position_embeddings":8192}'
The explicit override reproduces the 8K evaluation setting; it does not change
the exported 4K default. GPU memory requirements depend on context and
concurrency. Preserve fix_mistral_regex=false: enabling regex repair changes
tokenization relative to training and the reported evaluations.
Evaluation evidence and limitations
evaluations/ contains the standalone EuroEval zero-shot and few-shot
submission results. Keep these protocols separate from training-integrated
aggregates. model-verification.json and server-smoke.json preserve the
local evaluation checks; they are historical checks, not a claim of a new
Hub-based GPU test. Local paths in provenance identify the original run and
are not dependencies for loading these weights.
Checkpoint comparison
The complete training-integrated 50-language aggregate covers 396/396 metrics
at both checkpoints. Equal task weights within languages and equal language
weights give 65.7407 at step 1,500,000 and 66.0075 at final epoch 3.
The latter wins 33/50 language means. Excluding English and Danish, scores are
66.0426 and 66.3236 respectively. These are descriptive differences, not
statistical significance claims. See evaluation_results.json and
checkpoint_comparison.json. This aggregate includes its registered EuroEval
metrics; it must not be described as an aggregate excluding EuroEval.
The older 37/50-language report omitted existing result directories. The corrected aggregate includes all 50 languages and all 396 registered metrics.
The model may produce incorrect or unsupported answers. Benchmark coverage is not a guarantee of general capability across all tasks or languages.
Integrity
checksums.json records SHA-256 digests of release files. Weight bytes are
unchanged from the evaluated export. Mini's tokenizer packaging uses the
validated native tokenizer and chat template rather than the raw export's
regex-repair setting. Optimizer state is not included.
- Downloads last month
- 100