Instructions to use syvai/danskgpt-v4-12b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use syvai/danskgpt-v4-12b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="syvai/danskgpt-v4-12b") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("syvai/danskgpt-v4-12b") model = AutoModelForCausalLM.from_pretrained("syvai/danskgpt-v4-12b", 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 syvai/danskgpt-v4-12b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "syvai/danskgpt-v4-12b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "syvai/danskgpt-v4-12b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/syvai/danskgpt-v4-12b
- SGLang
How to use syvai/danskgpt-v4-12b 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 "syvai/danskgpt-v4-12b" \ --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": "syvai/danskgpt-v4-12b", "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 "syvai/danskgpt-v4-12b" \ --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": "syvai/danskgpt-v4-12b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use syvai/danskgpt-v4-12b with Docker Model Runner:
docker model run hf.co/syvai/danskgpt-v4-12b
Configuration Parsing Warning:In config.json: "num_experts" must be a number
danskgpt-v4-12b
A Danish fine-tune of google/gemma-4-12B-it,
tuned to be strong on Danish understanding, knowledge and reasoning tasks. It is a text-only
Gemma4ForCausalLM checkpoint in bf16. For an even stronger model see
syvai/danskgpt-v4-31b.
Usage
The model uses Gemma-4's chat format — always go through apply_chat_template (or vLLM's
chat) so the <|turn> / <turn|> markers are added correctly.
Transformers
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "syvai/danskgpt-v4-12b"
tok = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, dtype=torch.bfloat16, device_map="auto")
messages = [
{"role": "user", "content": "Forklar kort, hvad fotosyntese er, og hvorfor det er vigtigt."},
]
inputs = tok.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
out = model.generate(inputs, max_new_tokens=512, do_sample=True, temperature=0.7, top_p=0.9)
print(tok.decode(out[0][inputs.shape[-1]:], skip_special_tokens=True))
vLLM
from vllm import LLM, SamplingParams
llm = LLM(model="syvai/danskgpt-v4-12b", dtype="bfloat16")
messages = [
{"role": "user", "content": "Giv mig tre forslag til en hyggelig weekendtur i Jylland."},
]
out = llm.chat(messages, SamplingParams(temperature=0.7, top_p=0.9, max_tokens=512))
print(out[0].outputs[0].text)
More Danish prompt ideas: "Omskriv denne sætning, så den bliver mere formel: ...",
"Opsummer teksten nedenfor i tre punkter på dansk: ...",
"Er følgende anmeldelse positiv eller negativ? ...".
Training
danskgpt-v4-12b is a QLoRA fine-tune (rank 16, 4-bit NF4 base, bf16 compute) of
google/gemma-4-12B-it, trained on Danish task data to strengthen Danish understanding,
knowledge and reasoning.
Intended use & limitations
- Intended use: Danish NLP — classification, reading comprehension, knowledge/reasoning Q&A, NER, and general Danish assistant tasks.
- Limitations: As a task-tuned model, it can be more terse/decisive than the base on open-ended generation. It inherits the base model's biases and knowledge cutoff. Not intended for high-stakes use without human oversight.
License
Released under CC-BY-4.0, consistent with other SyvAI models. Use of the base model is additionally subject to Google's Gemma terms.
- Downloads last month
- 145