Instructions to use M2key1/HabsburgLLM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use M2key1/HabsburgLLM with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="M2key1/HabsburgLLM")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("M2key1/HabsburgLLM") model = AutoModelForCausalLM.from_pretrained("M2key1/HabsburgLLM", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use M2key1/HabsburgLLM with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "M2key1/HabsburgLLM" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "M2key1/HabsburgLLM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/M2key1/HabsburgLLM
- SGLang
How to use M2key1/HabsburgLLM 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 "M2key1/HabsburgLLM" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "M2key1/HabsburgLLM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "M2key1/HabsburgLLM" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "M2key1/HabsburgLLM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use M2key1/HabsburgLLM with Docker Model Runner:
docker model run hf.co/M2key1/HabsburgLLM
HabsburgLLM
A research project to train an LLM from scratch using only historical data. The goal is knowledge creation and research, not producing a production-quality language model. The focus is on learning what happens when a model is trained exclusively on historical texts. Not instruction-tuned yet. Instruction fine-tuning is in the works. Coming Soon™.
Code and training setup: https://github.com/m2key1/HabsburgLLM
Models
| Model | Where | Params | Language | Data | Weights |
|---|---|---|---|---|---|
| olmo-habsburg | repo root, main |
3.97B | German | Austrian newspapers, 1800 to June 1914 | fp32 |
| olmo-habsburg steps | branches habsburg-step-* |
3.97B | German | same | bf16 |
| olmo-london | olmo-london/final |
547M | English | London texts, 1800 to 1875 | fp32 |
All are OLMo 3 architecture (Olmo3ForCausalLM), each with its own byte-level BPE tokenizer.
olmo-habsburg - 32 layers, hidden size 3072, GQA (24 query / 8 KV heads), 4096-token context, 48k vocabulary. 5 epochs (23,285 steps, about 114B tokens seen) over 22.9B tokens of German-language Austrian newspapers from ANNO (Austrian National Library), 1800 to June 1914, re-OCRed for clean text. Trained on 8 NVIDIA H200 GPUs for 13.9 days on the DHinfra.at cluster in Graz. Final validation loss 1.910 (perplexity 6.75) on a held-out split of the same corpus.
olmo-london - 24 layers, hidden size 1024, 2048-token context, 32k vocabulary, trained on postgrammar/london-llm-1800.
Revisions
The final olmo-habsburg model is at the root of main (step 23,285). Intermediate checkpoints of the same run sit at the root of these branches:
habsburg-step-1000, habsburg-step-5000, habsburg-step-10000, habsburg-step-15000, habsburg-step-20000, habsburg-step-23000
Each includes trainer_state.json with the loss history up to that step.
Usage
Tested with transformers 5.9.0.
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "M2key1/HabsburgLLM"
device = "cuda" if torch.cuda.is_available() else "cpu"
def generate(prompt, subfolder=""):
tokenizer = AutoTokenizer.from_pretrained(repo, subfolder=subfolder)
model = AutoModelForCausalLM.from_pretrained(repo, subfolder=subfolder, dtype=torch.bfloat16).to(device)
inputs = tokenizer(prompt, return_tensors="pt").to(device)
output = model.generate(
**inputs,
max_new_tokens=128,
do_sample=True,
temperature=0.8,
top_p=0.95,
no_repeat_ngram_size=6,
)
return tokenizer.decode(output[0], skip_special_tokens=True)
print(generate("Wien, 27. Juni.")) # olmo-habsburg
print(generate("London, June 1851.", subfolder="olmo-london/final")) # olmo-london
Intermediate checkpoint: add revision="habsburg-step-5000" to both from_pretrained calls.
Limitations
- Base model: it continues text in period style rather than answering questions. Asked about events, it reproduces the genre where such text would appear, mixing real and invented detail in a convincing register.
- It almost never emits an end-of-sequence token, so generation runs to
max_new_tokens. - Greedy and beam decoding fall into loops; use sampling with
no_repeat_ngram_size=6. - It reflects the views, language and biases of its sources.
Citation
@software{fleischhacker_habsburgllm,
author = {Fleischhacker, David},
title = {HabsburgLLM},
year = {2026},
url = {https://github.com/m2key1/HabsburgLLM}
}
- Downloads last month
- 26