Contents
Model at a glance
Table with columns: Item, Details| Item | Details |
|---|
| Developer | National Library of Norway |
| Access | Public download; no access approval required |
| License | Apache 2.0 |
| Model | Nordlyd Qwen 0.6B, November 2026 preview |
| Task | Speech recognition and speech translation |
| Base checkpoint | Qwen3-ASR-0.6B with a custom tokenizer |
| Output languages | Norwegian Bokmål (nob), Norwegian Nynorsk (nno), English (eng) |
| Styles | Reading-optimised (default) and verbatim |
| Experimental feature | Language-preserving Norwegian–English transcription |
| Inference | Transformers or offline vLLM through the supplied helper |
| Example hardware | CUDA GPU using bfloat16; see setup |
| Word timestamps | Require a separate Norwegian forced aligner; see timestamps |
Quick start: transcribe a recording
The examples use inference.py, a small helper supplied in this repository. It handles Nordlyd's language and style prompts, reads local audio, and converts it to mono at 16 kHz. You do not need to prepare prompts yourself.
1. Prepare your environment
Use a machine with a CUDA-capable NVIDIA GPU and a compatible PyTorch installation. The helper loads the model in bfloat16 on cuda:0 by default, so your GPU must support that dtype. These instructions do not establish CPU or Apple Silicon compatibility, or a minimum GPU memory requirement.
Start with a fresh Python 3.12 environment, following the upstream Qwen3-ASR setup guidance:
python3.12 -m venv .venvsource .venv/bin/activatepython -m pip install --upgrade pippython -m pip install qwen-asr soundfile scipy huggingface_hub
Check that PyTorch can see the GPU:
python -c "import torch; print('CUDA available:', torch.cuda.is_available())"
Expected result: CUDA available: True. If it prints False, check your NVIDIA driver and PyTorch installation before continuing.
2. Download the helper and example audio
Hugging Face hosts the model weights, tokenizer, and supporting files. Download the helper and the two example recordings into your current directory:
hf download NbAiLab/nordlyd-asr-qwen06B-nov26preview \ inference.py \ audio/p1_g08_f2_1_t-b0694.wav \ audio/p1_g09_f1_2_t-b0911.wav \ --local-dir .
The model weights are downloaded and cached when you first run the helper.
The examples are read-speech utterances from NB Tale. The recordings originate from module 1 of NB Tale, available through Språkbanken, which distributes the source resource under CC0.
3. Transcribe an example
Start with this recording of sentence b0694, using the Nynorsk reading-optimised mode:
python inference.py audio/p1_g08_f2_1_t-b0694.wav \ --target-lang nno --style reading_optimised
Recorded model output (text field):
Sistnemnde var både rusa og uønskt, og huseigaren såg gjerne at gjesten skygde banen.
The helper returns a JSON object containing text, target_lang, style, duration_seconds, truncated, and timestamps. The first run also downloads and loads the model, so it takes longer than subsequent runs. Your output may vary with the model revision and runtime.
Check text against the audio and inspect truncated. A value of true means the output reached its token budget and may be incomplete. See long recordings before processing a larger file.
To use your own audio, replace the example path with a local recording. Continue below for another example with and without contextual keywords.
Choose the language and transcription style
--target-lang selects the output language or written standard:
Table with columns: Option, Output, Example| Option | Output | Example |
|---|
nob | Norwegian Bokmål (default) | python inference.py recording.wav --target-lang nob |
nno | Norwegian Nynorsk | python inference.py recording.wav --target-lang nno |
eng | English text from Norwegian speech | python inference.py recording.wav --target-lang eng |
Choose a style independently of the output language:
Table with columns: Option, Intended use| Option | Intended use |
|---|
--style reading_optimised | Default style for readable written text. |
--style verbatim | A more literal transcription; useful when retaining spoken wording matters, including for alignment. |
python inference.py recording.wav --target-lang nno --style verbatim
Verbatim output can still contain recognition errors and omissions. Neither style should be treated as a verified transcript.
Example: Transcription with and without keywords
Contextual keywords provide hints about names or specialist terms. This example uses the same recording of sentence b0911 twice, keeping the target language (Bokmål) and style fixed.
1. Transcribe without keywords
python inference.py audio/p1_g09_f1_2_t-b0911.wav \ --target-lang nob --style reading_optimised
Recorded model output (text field):
Pressetalsmann Jonas Sprangrød i øyafestivalen innrømmer at han ventet seg reaksjoner på det store utbyttet.
2. Supply the name and festival as keywords
Pass the keywords as one quoted, space-separated string:
python inference.py audio/p1_g09_f1_2_t-b0911.wav \ --target-lang nob --style reading_optimised \ --keywords "Jonas Prangerød Øyafestivalen"
Recorded model output (text field):
Pressetalsmann Jonas Prangerød i Øyafestivalen innrømmer at han ventet seg reaksjoner på det store utbyttet.
In this recording, the keywords correct Sprangrød → Prangerød and the capitalisation of Øyafestivalen. Keywords are hints, not a guarantee of correct recognition on other recordings.
Use the model from Python
Save this as a script alongside the downloaded inference.py. Load the model once and reuse it for multiple recordings.
from inference import NordlydASR def main(): asr = NordlydASR(backend="transformers") result = asr.transcribe( "audio/p1_g09_f1_2_t-b0911.wav", target_lang="nob", style="reading_optimised", keywords="Jonas Prangerød Øyafestivalen", ) print(result["text"]) print("Reached token limit:", result["truncated"]) if __name__ == "__main__": main()
The helper loads this Nordlyd preview by default.
Optional: use vLLM
vLLM is an inference engine for running models efficiently on GPUs. You can start with Transformers above and try vLLM when you need an alternative inference backend.
Install the Qwen package's vLLM dependencies in an environment compatible with your CUDA stack:
python -m pip install "qwen-asr[vllm]"
Then select the backend:
python inference.py recording.wav --backend vllm --target-lang nob
This runs offline inference in the local process; you do not need to start an API server. In Python, change the constructor to NordlydASR(backend="vllm") and keep the if __name__ == "__main__": guard shown above.
For dependency and GPU compatibility details, consult the vLLM installation guide. For API serving, consult the upstream Qwen3-ASR deployment examples together with Nordlyd's prompt format; a custom client must reproduce Nordlyd's controls.
Preserve Norwegian–English language switches
The experimental --notranslate option keeps Norwegian and English passages in their spoken languages. Select nob or nno for the spelling of Norwegian passages; English passages remain in English.
python inference.py meeting.wav --target-lang nno --notranslate
This can also be combined with --backend vllm, --style verbatim, and contextual keywords.
The helper returns additional fields:
Table with columns: Field, Meaning| Field | Meaning |
|---|
raw_tagged_text | Transcript with <lang_no> and <lang_en> markers. |
text | Plain text with the language markers removed. |
language_spans | Language, text, and character offsets for each passage. |
errors | Diagnostics for missing, repeated, unsupported, or otherwise malformed language markers. An empty list means no format errors were detected. |
For example, the tagged output might be:
<lang_no>Hei, alle saman. <lang_en>Today we are going to win!
Norwegian passages use <lang_no> for both Bokmål and Nynorsk. Character offsets in language_spans refer to the plain text: they start at zero and exclude the end position. They are not audio timestamps.
Inspect errors before relying on language labels. Valid formatting does not establish that recognition or language identification is correct. Training used monolingual recordings and synthetic joins; recognition of natural switches within a sentence remains experimental. Other reserved language tokens do not establish support for additional languages.
Optional: word timestamps
Forced alignment matches transcript words to their positions in the audio. It requires a separate Norwegian aligner; timestamps are not produced by the speech recognition model alone.
Both the ASR model and the Nordlyd forced aligner are publicly downloadable. No access approval is required. The aligner is downloaded separately when you request timestamps.
For Norwegian speech, use verbatim output and a recording no longer than 180 seconds (see the forced aligner limitations for further details):
python inference.py recording.wav --target-lang nob \ --style verbatim --timestamps
Expected result: the JSON timestamps field contains word entries with text, start, and end; times are in seconds relative to the supplied recording. Loading the aligner requires an additional model download and GPU memory.
For Python use, call asr.load_aligner() before asr.transcribe(..., timestamps=True).
- Do not align an English translation to Norwegian speech. The helper rejects
--target-lang eng with timestamps.
--notranslate and --timestamps cannot be combined in this helper. Automatic mixed-language alignment is unvalidated.
- For mixed speech, parse the language spans first and pass marker-free text to an appropriate aligner. If you have audio boundaries for individual passages, align each segment with an aligner for that language, then add its audio start time to the returned timestamps. Text character offsets alone do not supply those boundaries.
For custom workflows, the helper's label_aligned_words can attach language labels when the aligned words match the transcript's whitespace tokenisation exactly.
Long recordings and troubleshooting
The helper accepts recordings up to 1,200 seconds (20 minutes). This is an input limit, not a guarantee of complete or accurate transcription at that length. It does not automatically split recordings into chunks.
Table with columns: Symptom, What to check| Symptom | What to check |
|---|
truncated is true | Increase --max-new-tokens from its default of 4096, within the model's available context and GPU memory, or split the recording into shorter segments. |
| Recording exceeds 20 minutes | Split it explicitly and transcribe each segment. Keep each segment's start time if you later need timestamps for the original recording. |
| CUDA or bfloat16 error | Check GPU availability, dtype support, and the installed PyTorch/CUDA combination. |
| GPU runs out of memory | Try shorter recordings. For vLLM, review --gpu-memory-utilization (default 0.6) and --max-model-len (default 32768); lowering memory utilisation also reduces available runtime capacity. |
| Audio cannot be read | Use a WAV file or another format supported by your SoundFile/libsndfile installation. The helper averages channels to mono, so separate speaker channels beforehand if needed. |
| Model download fails | Check your network connection and the repository ID. For timestamps, the separate aligner must also be downloaded. |
| Language-preserving output has format errors | Inspect errors and retain raw_tagged_text for diagnosis. |
Run python inference.py --help for all available options.
For repeatable experiments, record the model revision and package versions. You can download a specific model revision with hf download ... --revision COMMIT --local-dir MODEL_DIR and select that directory with --model MODEL_DIR; download the helper from the same revision.
Evaluation
The following results measure Bokmål short-form transcription on a held-out evaluation set. In this dataset, all transcriptions were validated by Språkrådet for correctness and consistency. The metric is capped word error rate (WER, %); lower is better.
These scores use a capped error calculation: each clip's word errors are capped at its reference word count before aggregation. This differs from uncapped WER, so compare results only when the evaluation data, text normalisation, and scoring procedure match. Reading mode uses an empty style prompt; verbatim uses the user style control.
Table with columns: Checkpoint, Overall reading, Overall verbatim, NST reading, NST verbatim| Checkpoint | Overall reading | Overall verbatim | NST reading | NST verbatim |
|---|
| NB-Whisper Small | 15.28 | 17.34 | 16.16 | 15.36 |
| NB-Whisper Medium | 12.48 | 14.81 | 9.29 | 8.66 |
| NB-Whisper Large | 12.67 | 15.11 | 7.50 | 6.79 |
| Nordlyd Qwen 0.6B | 9.21 | 9.17 | 4.20 | 4.29 |
NST denotes the NST Norwegian speech subset.
This model also appears to produce fewer "hallucinations". On a no-caption evaluation set, 1% of clips returned text in reading mode and 4% in verbatim mode. These are rates of output presence, not verified hallucination rates: clips can include faint background speech.
These short-form results do not measure the accuracy of language tags or natural code-switching, and do not establish performance for Nynorsk, English translation, or long recordings. Evaluation configuration and dataset revision references are recorded in training_configs.md.
Training and provenance
This preview continues the five-epoch Nordlyd beta02 0.6B model for 10,000 additional steps on the Gold mixture, restoring the optimizer state. The released checkpoint is step 114,195.
Table with columns: Setting, Value| Setting | Value |
|---|
| Continuation learning rate | Cosine decay from 1e-5 to 1e-6, without warmup |
| Training GPUs | 64 |
| Audio augmentation probability | 0.5 |
| Training-only BPE dropout | 0.1 |
The continuation source inventory includes reading and verbatim transcripts, pseudo-labelled speech, Stortinget recordings, synthetic number and rare-word material, English speech sources, and recordings with intentionally empty targets for noise. The language-preserving task uses monolingual recordings and synthetic Norwegian–English joins.
See training_configs.md for the detailed source inventory and launch settings. Internal checkpoint reference: nordlyd-beta02-06b-gold1of2-final-10k-cosine-10pct.
Advanced: build your own prompts
The supplied helper implements the following format. Use the bundled tokenizer and chat template when building a custom client.
Table with columns: Message, Content| Message | Content |
|---|
| System | Empty by default. Use space-separated contextual keywords, or start with <notranslate> to preserve spoken languages. |
| User | Audio, optionally followed by the <verbatim> control. Reading-optimised mode uses audio alone. |
Assistant prefix for nob | language Norwegian<asr_text> |
Assistant prefix for nno | language Norwegian Nynorsk<asr_text> |
Assistant prefix for eng | language English<asr_text> |
Render the system and user messages with the bundled chat template and the assistant generation prompt, then append the selected assistant prefix once. Supply audio through the model's audio input and decode only newly generated tokens. These language names are literal prefill strings.
For language-preserving output, keep <lang_no> and <lang_en> through decoding and parse them before transcript cleanup. The bundled tokenizer retains these markers even with skip_special_tokens=True. See the helper's make_prompt and parse_tagged functions for the implementation.
Limitations and responsible use
- Recognition errors: the preview can repeat, omit, or substitute words, including names and specialist vocabulary. Review transcripts against the recording when accuracy matters.
- Transcription style: reading-optimised output and verbatim output serve different purposes. Neither guarantees an exact record of what was spoken.
- Language switching: natural within-sentence Norwegian–English switching is experimental. Synthetic joins used in training do not establish performance on spontaneous bilingual speech.
- Language coverage: inherited language lists and reserved tokenizer symbols do not establish evaluated support beyond the capabilities described here.
- Evaluation coverage: the reported scores cover Bokmål short-form recognition. They do not establish equal performance across dialects, speakers, recording conditions, or domains; evaluate your intended use separately.
- Timestamps: alignment depends on the transcript and a separate model. Incorrect words can produce misleading word times. Automatic mixed-language alignment is unvalidated.
Handle recordings and transcripts according to your organisation's privacy and data-handling requirements. For uses where errors could affect people, include human review appropriate to the task.
License, feedback and acknowledgments
This model is released under the Apache License 2.0. See LICENSE for the full terms.
Report reproducible issues through this repository's Community tab. Include the model revision, backend, package versions, relevant options, and whether truncated or language-format errors were reported. Share audio only when you have permission to do so. If you are unable to describe the issue publicly (due to copyright or other privacy concerns), then email ai-lab@nb.no.
When referring to this preview, use Nordlyd Qwen 0.6B — November 2026 preview, National Library of Norway, together with the model repository and revision used.
Nordlyd is a research project at the National Library of Norway. The National Library of Norway retains full ownership of the models and associated research outputs. Research contributions were made by Phoebe Parsons, Freddy Wetjen, Thea Tollersud, and Per Egil Kummervold, who take responsibility for any remaining errors and shortcomings.
We would like to acknowledge Sigma2 for providing computational and storage resources on the Olivia/LUMI HPC system under project NN30001K.