A locally runnable, Swedish-enhanced European AI assistant built on Gemma 2 9B Instruct.
Diabase Europa 9B is a light fine-tune for Swedish and European enterprise use: clearer
instruction following, better Swedish assistant behavior, and practical answers on AI,
data, compliance, and sovereign deployment topics. It is designed to run on your own
hardware without sending prompts to a third-party API.
This repository ships a merged GGUF (Q4_K_M) plus an Ollama Modelfile with the
release system prompt baked in. One download, three commands, ready to chat.
Prerequisites:Ollama installed, Gemma license accepted on Hugging Face if required by your org.
bash
1# 1. Download model files from this repo2huggingface-cli download diabase/europa-9b-GGUF gemma-2-9b-it.Q4_K_M.gguf Modelfile
34# 2. Create the local model (includes Diabase system prompt)5cd<download-folder>6ollama create diabase-europa-9b -f Modelfile
78# 3. Run9ollama run diabase-europa-9b
Try it:
Svara på svenska: Vad är Diabase Europa och hur skiljer det sig från amerikanska AI-tjänster?
Expected behavior: third-person description, natural Swedish, uses öppna vikter rather than invented calques like öppenkälla.
What is in this repo
File
Purpose
gemma-2-9b-it.Q4_K_M.gguf
Quantized merged model (base + Diabase adapter)
Modelfile
Ollama config with Gemma chat template + bundled system prompt
README.md
This model card
The system prompt is intentionally public in Modelfile. It is not hidden during
inspection (ollama show diabase-europa-9b --modelfile), but it is not shown in normal
chat. You may customize it for your deployment.
What this model is
A Gemma 2 9B Instruct derivative with a light QLoRA SFT adapter merged in
Tuned for Swedish assistant behavior, European context, and enterprise AI topics
Open-weight and locally deployable on consumer hardware
Transparently evaluated on EuroEval Swedish benchmarks
What this model is not
Not trained from scratch on Swedish corpora
Not a frontier-scale model competing with GPT-4 class systems on raw capability
Not a safety-certified or compliance-certified product out of the box
Not a replacement for legal, medical, or security review by qualified professionals
Intended use
Swedish and multilingual assistant workflows in European organizations
On-prem or private cloud deployments where data residency matters
AI/ML, data engineering, compliance, and sovereign AI education and drafting
Prototyping European AI products before heavier customization
Out of scope
Fully autonomous decision-making without human review
High-stakes legal, medical, or financial advice without expert validation
Claims of automatic GDPR, NIS2, or EU AI Act compliance from model use alone
Environments requiring formal safety red-teaming or guaranteed factual accuracy
Evaluation (EuroEval Swedish)
Compared against the same base model (unsloth/gemma-2-9b-it-bnb-4bit) under
identical eval settings (4-bit, vLLM, 4096 context, Triton).
Task
Metric
Base Gemma 2 9B
Diabase v1.0
Delta
IFEval-sv
accuracy
75.53
77.23
+1.70
HellaSwag-sv
MCC
56.91
57.45
+0.54
HellaSwag-sv
accuracy
67.30
67.77
+0.47
multi-wiki-qa-sv
F1
74.69
74.10
-0.59
multi-wiki-qa-sv
EM
55.02
54.59
-0.43
MMLU-sv
MCC
51.95
51.21
-0.74
MMLU-sv
accuracy
63.75
63.20
-0.55
SUC3 (NER)
micro-F1
32.68
33.41
+0.73
SUC3 (NER)
micro-F1-no-misc
50.69
51.77
+1.08
SweReC
MCC
74.11
73.34
-0.77
ScaLA-sv
MCC
56.35
56.23
-0.12
Summary: Knowledge and reasoning are preserved within noise. The clearest win is
instruction following (+1.7 IFEval). This is a polish on a strong base, not a
leaderboard revolution. That is by design: we optimized for a safe, deployable Swedish
assistant rather than benchmark chasing at the cost of general capability.
Full baseline documented in the Diabase model lab release materials.
Example output
Prompt: Vad är Diabase Europa och hur skiljer det sig från amerikanska AI-tjänster?
Response (Ollama, v1.0):
Diabase Europa är en AI-assistent med öppna vikter, byggd för svenska och europeiska
sammanhang. Den är anpassad för svenska språket och europeiska behov. Diabase Europa
är utformad med fokus på integritet, praktisk användbarhet och lokal relevans.
Skillnaden mot många amerikanska AI-tjänster ligger i fokus. Diabase Europa är tänkt
att användas i europeiska sammanhang med hänsyn till GDPR, dataresidency och andra
europeiska krav...
Other ways to run
llama.cpp
bash
1./llama-cli \2 -m gemma-2-9b-it.Q4_K_M.gguf \3 -p "<start_of_turn>user\nHej! Förklara kort vad fine-tuning är.<end_of_turn>\n<start_of_turn>model\n"\4 -n 256\5 --temp 0.7
For llama.cpp, supply the system prompt manually or via your client. See the SYSTEM
block in Modelfile.
Transformers + LoRA (advanced, for fine-tuning)
Use the separate LoRA adapter repo if you want to continue training or serve via PEFT:
python
1from pathlib import Path
2import torch
3from peft import PeftModel
4from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
56BASE ="unsloth/gemma-2-9b-it-bnb-4bit"7ADAPTER ="diabase/europa-9b-v1.0-lora"89system = Path("prompts/diabase_europa_v1_system.txt").read_text(encoding="utf-8").strip()1011tokenizer = AutoTokenizer.from_pretrained(BASE)12model = AutoModelForCausalLM.from_pretrained(13 BASE,14 quantization_config=BitsAndBytesConfig(load_in_4bit=True),15 device_map="auto",16 torch_dtype=torch.bfloat16 if torch.cuda.is_bf16_supported()else torch.float16,17)18model = PeftModel.from_pretrained(model, ADAPTER)19model.eval()2021messages =[22{"role":"system","content": system},23{"role":"user","content":"Svara på svenska: Vad innebär digital suveränitet?"},24]25prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)26inputs = tokenizer(prompt, return_tensors="pt").to(model.device)2728with torch.no_grad():29 out = model.generate(**inputs, max_new_tokens=256, do_sample=False)3031print(tokenizer.decode(out[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))
Training
Diabase Europa v1.0 uses a light SFT recipe directly on Gemma 2 9B Instruct. No
continued pre-training. No aggressive full-model fine-tuning.
Parameter
Value
Method
QLoRA SFT (4-bit NF4)
LoRA rank / alpha
16 / 16
Target modules
Attention only (q, k, v, o projections)
Learning rate
5e-6
Epochs
1
Effective batch size
8
Max sequence length
2048
Trainable params
~0.35% of base
Training data (~575 synthetic instruction examples)
Category
~Examples
Focus
General AI/ML
150
Concepts, tools, practices
Coding
110
Python, TypeScript, ML infra
Reasoning
85
Diagnostics, analysis
Multilingual
90
Major European languages
Sovereign AI
80
Data sovereignty, compliance
Swedish
60
Dedicated Swedish scenarios
All examples are synthetically generated. No personal data or private information.
Human-reviewed curation is planned for v1.1.
Limitations
Early-stage release. Strongest as a Swedish/European assistant polish on Gemma 2, not a from-scratch Swedish foundation model.
Small SFT set. Shapes behavior and tone; does not inject large amounts of new knowledge.
Hallucinations. Can produce plausible but incorrect answers. Verify important facts.
Terminology. Improves with the bundled system prompt; some edge cases remain. DPO and human-reviewed data planned for v1.1.
Benchmark variance. Small regressions on some EuroEval tasks are within expected noise for light SFT.
Roadmap
Version
Focus
v1.1
Human-reviewed Swedish data, curator workflow, DPO for terminology
v1.2
Controlled targeted SFT (NER, strict QA) without general capability loss
v2
Newer ~12B base model, larger curated Swedish mix
About Diabase
Diabase builds European AI infrastructure for organizations that
want open-weight models, local deployment, and transparent evaluation. We document what
we train, what we measure, and what we do not claim.
Diabase fine-tuning artifacts, documentation, and the bundled system prompt are
provided under the Apache 2.0 License
where applicable. You must comply with both the Gemma license and applicable law when
using, modifying, or redistributing this model.