Text Generation
Transformers
Safetensors
Danish
English
hrm_text
danish
english
foundation-model
instruction-tuned
conversational
Instructions to use danish-foundation-models/DFM-Mimir with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use danish-foundation-models/DFM-Mimir with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="danish-foundation-models/DFM-Mimir") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("danish-foundation-models/DFM-Mimir") model = AutoModelForCausalLM.from_pretrained("danish-foundation-models/DFM-Mimir", 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=40) 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 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" # 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", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/danish-foundation-models/DFM-Mimir
- SGLang
How to use danish-foundation-models/DFM-Mimir 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" \ --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", "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" \ --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", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use danish-foundation-models/DFM-Mimir with Docker Model Runner:
docker model run hf.co/danish-foundation-models/DFM-Mimir
| MIMIR LICENSE v1.0 — RESEARCH MODEL LICENSE | |
| Copyright © Danish Foundation Models. All rights reserved except as expressly | |
| granted under this License. | |
| 1. Purpose and Scope | |
| This License enables broad access to, study of, modification of, and | |
| redistribution of the Model for non-commercial research. | |
| The Model was developed using, among other lawful bases, text and data mining | |
| carried out in reliance on applicable implementations of Article 3 of Directive | |
| (EU) 2019/790. This statement describes aspects of the Model's development. It | |
| does not grant rights in any third-party training material or represent that | |
| any exception or limitation relied upon by the Licensor applies to Your | |
| activities. | |
| By exercising rights granted under this License, You accept its terms. | |
| 2. Definitions | |
| "Licensor" means Danish Foundation Models. | |
| "Model" means the machine-learning weights, parameters, checkpoints, | |
| configuration files, and other model artifacts distributed by the Licensor | |
| under this License. | |
| "Derivative Model" means, solely for purposes of this License, a modified or | |
| adapted version of the Model, including a version produced through fine-tuning, | |
| quantization, pruning, merging, distillation, adaptation, or | |
| reparameterization. This definition does not determine whether any such Model | |
| constitutes a derivative work under applicable copyright law. | |
| "Research Use" means scientific research, experimentation, teaching, study, | |
| evaluation, reproducibility, benchmarking, security or safety research, or | |
| publication of research results. | |
| "Non-Commercial" means not primarily intended for or directed toward commercial | |
| advantage or monetary compensation. | |
| Public or charitable research funding, ordinary salaries, scholarships, grants, | |
| recovery of reasonable research costs, academic publication, and research | |
| collaboration do not by themselves constitute Commercial Use. | |
| "Commercial Use" means use of the Model or a Derivative Model primarily | |
| intended for or directed toward commercial advantage or monetary compensation, | |
| including incorporation into or provision of a paid product or service. | |
| "Output" means content generated by operating the Model or a Derivative Model. | |
| "You" means the individual or legal entity exercising rights under this | |
| License. | |
| 3. Grant of Rights | |
| Subject to this License, and to the extent the Licensor has authority to grant | |
| the relevant rights, the Licensor grants You a worldwide, royalty-free, | |
| non-exclusive license to: | |
| a. use, reproduce, run, inspect, study, evaluate, benchmark, and research the | |
| Model; | |
| b. modify, fine-tune, adapt, merge, quantize, prune, distill, reparameterize, | |
| and otherwise create Derivative Models; | |
| c. reproduce and redistribute the Model and Derivative Models; and | |
| d. publish research results, methods, evaluations, benchmarks, modifications, | |
| and other findings concerning the Model, | |
| in each case for Non-Commercial Research Use. | |
| No rights in third-party training materials, datasets, trademarks, personal | |
| data, or other third-party subject matter are granted by this License. | |
| 4. Redistribution and Downstream Licensing | |
| You may redistribute the Model or a Derivative Model provided that You: | |
| a. provide recipients with a copy of this License; | |
| b. retain copyright, attribution, provenance, and other legal notices supplied | |
| with the Model; and | |
| c. clearly identify material modifications You have made. | |
| You may license Your own modifications, additions, software, adapters, | |
| documentation, and other contributions under terms of Your choice. | |
| You may also apply additional or different terms to a Derivative Model, | |
| provided that: | |
| a. those terms do not purport to remove, supersede, or expand the rights | |
| granted under this License with respect to the Model or portions derived | |
| from it; | |
| b. the restrictions in Sections 5 and 6 continue to apply to use of the Model | |
| and any Derivative Model incorporating or based upon the Model; and | |
| c. recipients are given notice that the Model remains subject to this License. | |
| No downstream license, modification, or redistribution expands the rights | |
| granted by the Licensor. | |
| 5. Commercial Use | |
| This License does not grant permission for Commercial Use of the Model or a | |
| Derivative Model. | |
| For clarity, the following do not by themselves constitute Commercial Use: | |
| a. research performed by an employee of a commercial entity where the | |
| particular use is genuinely Non-Commercial Research Use; | |
| b. collaboration between academic and commercial researchers where the Model is | |
| not incorporated into or used to provide a commercial product or service; | |
| c. publication of research, including through commercial academic publishers; | |
| or | |
| d. reasonable cost recovery associated with research infrastructure or | |
| dissemination. | |
| Commercial rights may be available separately from the Licensor. | |
| 6. Use Restrictions | |
| You may not use the Model or a Derivative Model: | |
| a. in intentional violation of applicable law; | |
| b. for the purpose of intentionally causing or facilitating serious unlawful | |
| harm to a person; | |
| c. to conduct unlawful biometric identification, surveillance, or tracking of | |
| persons; | |
| d. to make fully automated decisions concerning an individual where applicable | |
| law requires qualified human judgment and that requirement is not satisfied; | |
| or | |
| e. intentionally to exploit children or other persons in violation of | |
| applicable law. | |
| These restrictions do not prohibit good-faith scientific research, security | |
| research, red-teaming, auditing, testing, benchmarking, evaluation, or | |
| research into harmful or unlawful uses, provided that such activity is itself | |
| lawful. | |
| 7. Outputs | |
| Except to the extent the Licensor owns rights that necessarily subsist in an | |
| Output, the Licensor claims no rights under this License in Outputs. | |
| This License does not grant permission to use any third-party work, trademark, | |
| personal data, likeness, or other protected subject matter that may appear in | |
| an Output. | |
| You are solely responsible for determining whether Your generation, use, | |
| publication, or distribution of Outputs complies with applicable law and | |
| third-party rights. | |
| 8. Training Data and Third-Party Rights | |
| The underlying training corpus is not licensed or provided under this License | |
| merely because the Model is distributed. | |
| The Licensor does not represent or warrant that: | |
| a. the Model or Outputs are free from third-party rights; | |
| b. use of the Model, a Derivative Model, or Outputs will be non-infringing in | |
| every jurisdiction or circumstance; | |
| c. any copyright exception or limitation relied upon during development applies | |
| to Your activities; or | |
| d. Your particular use, modification, redistribution, deployment, or | |
| exploitation of the Model is lawful. | |
| Each recipient is independently responsible for establishing the legal basis | |
| for its activities involving the Model, Derivative Models, and Outputs. | |
| 9. No Endorsement or Agency | |
| Redistribution, modification, or downstream licensing of the Model or a | |
| Derivative Model does not constitute authorization, endorsement, sponsorship, | |
| partnership, agency, or approval by the Licensor of the recipient, the | |
| Derivative Model, or any use thereof. | |
| No right to use the Licensor's name, trademarks, or branding is granted except | |
| as reasonably necessary to identify the origin of the Model and comply with | |
| attribution requirements. | |
| 10. Disclaimer of Warranty | |
| THE MODEL IS PROVIDED "AS IS" AND "AS AVAILABLE," WITHOUT WARRANTIES OR | |
| CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING WARRANTIES OF TITLE, | |
| NON-INFRINGEMENT, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, | |
| RELIABILITY, SECURITY, OR ABSENCE OF DEFECTS. | |
| YOU ASSUME ALL RISKS ARISING FROM YOUR USE OF THE MODEL, DERIVATIVE MODELS, | |
| AND OUTPUTS. | |
| 11. Limitation of Liability | |
| TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSOR AND ITS | |
| CONTRIBUTORS SHALL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | |
| EXEMPLARY, CONSEQUENTIAL, OR OTHER DAMAGES ARISING FROM OR RELATING TO THE | |
| MODEL, DERIVATIVE MODELS, OUTPUTS, OR THIS LICENSE, HOWEVER CAUSED AND UNDER | |
| ANY THEORY OF LIABILITY. | |
| Nothing in this License excludes or limits liability to the extent such | |
| liability cannot lawfully be excluded or limited. | |
| 12. Termination and Reinstatement | |
| Your rights under this License terminate automatically if You materially violate | |
| its terms. | |
| If the violation is curable, Your rights are reinstated automatically if You | |
| cure the violation within 30 days after becoming aware of it. | |
| Termination does not affect rights validly granted to downstream recipients | |
| before termination, provided that those recipients independently comply with | |
| this License. | |
| Sections 7 through 14 survive termination to the extent necessary to give them | |
| effect. | |
| 13. Independent Legal Rights | |
| Nothing in this License restricts any use that You may make independently under | |
| applicable law, including under copyright exceptions or limitations. | |
| Where permission from the Licensor is not legally required for an activity, | |
| this License does not purport to make that activity dependent upon permission | |
| from the Licensor. | |
| 14. Entire License and Severability | |
| This License states the terms on which the Licensor grants rights in the Model. | |
| If any provision is held unenforceable, that provision shall be applied to the | |
| maximum extent permitted by law and the remaining provisions shall remain in | |
| effect. | |
| No failure by the Licensor to enforce any provision constitutes a waiver of | |
| that provision. |