Motivation
Apertus 1.5 is released as the multimodal architecture apertus1p5 (image + audio + text input, text output). This architecture is not yet part of a released transformers version (upstreaming: huggingface/transformers#47662) and is consequently not recognized by downstream tooling such as Unsloth.
This repository makes the Apertus 1.5 text backbone available in the original, widely supported apertus format. The backbone carries the improvements of the 1.5 release: continued pretraining on 4T additional tokens, a 262K context window, an optional thinking mode, tool calling, and improved instruction following.
A text-only checkpoint is also a deliberate design goal in its own right. Many workloads — fine-tuning, agents, RAG, chat — never use the multimodal towers. Removing them reduces the checkpoint from roughly 9B to 8.05B parameters (about 16.1 GB instead of 18+ GB in bf16), shortens downloads, lowers memory requirements, and eliminates all multimodal dependencies.
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
tokenizer = AutoTokenizer.from_pretrained("andreasmartin/apertus-v1.5-8b-text")
model = AutoModelForCausalLM.from_pretrained("andreasmartin/apertus-v1.5-8b-text", dtype=torch.bfloat16, device_map="auto")
ids = tokenizer("The capital of Switzerland is", return_tensors="pt").to(model.device)
print(tokenizer.decode(model.generate(**ids, max_new_tokens=64, do_sample=False)))
Unsloth (fine-tuning)
from unsloth import FastLanguageModel
model, tokenizer = FastLanguageModel.from_pretrained(
model_name="andreasmartin/apertus-v1.5-8b-text",
max_seq_length=8192,
load_in_4bit=True,
)
Thinking mode
Disabled by default; enabled through the chat template, identical to the source model:
tokenizer.apply_chat_template(messages, tokenize=False,
add_generation_prompt=True, enable_thinking=True)
The model reasons between <|inner_prefix|> and <|inner_suffix|> before producing the final answer. For serving with vLLM, use --reasoning-parser apertus. In LM Studio, the included model.yaml exposes an "Enable Thinking" toggle; for manually imported GGUF files, set the reasoning start/end strings to <|inner_prefix|> / <|inner_suffix|> in the inference settings.
Pass tools=[...] to apply_chat_template; the model emits calls as JSON between <|tools_prefix|> and <|tools_suffix|>. As with the source model, tool calling is supported in non-thinking mode. For agentic use, provide your own system prompt — the chat template's default system prompt describes the original multimodal model.
Chat-engine compatibility
The tokenizer's scalar eos_token is set to <|assistant_end|> (the turn-end token), so engines that read it (LM Studio, llama.cpp, Ollama) terminate turns correctly. generation_config.json retains the original eos list [2, 68, 72] for transformers and vLLM.
Conversion methodology
The conversion was performed as tensor-level surgery on the official safetensors checkpoint. All backbone weights are bit-identical bf16 copies; the only newly created tensors are the 200 LM-head rows for special tokens. This section constitutes the prominent notice of changes required by Apache License 2.0, Section 4.
Table with columns: #, Change, Rationale| # | Change | Rationale |
|---|
| 1 | model.language_model.* weights retained, renamed to model.* (bit-identical) | The text backbone is a standard Apertus architecture |
| 2 | LM head rows 0–131,072 retained (bit-identical) | The source authors pruned the head to text tokens |
| 3 | 200 LM-head rows added for special tokens (ids 131,072–131,271), mean-initialized | A standard ApertusForCausalLM requires matching embedding/head widths; the released head cannot generate special tokens |
| 4 | Emu3.5 vision tokenizer and WavTokenizer audio tower removed |
Differences from the source model
- No multimodal input. Image and audio understanding require the original checkpoint and the Swiss AI transformers fork.
- Special-token generation. The 200 added head rows are newly initialized and untrained. The source model cannot generate these tokens at all (pruned head); here they carry finite, untrained logits. Irrelevant under standard decoding and chat templates, but special-token ids should be masked (
-100) in training labels.
- Verification status. Conversion-time checks covered tensor inventory, vocabulary bounds, and shape consistency. A full logit-parity comparison against the source model was not performed; the backbone weights are bit-identical copies by construction.
License and acceptable use
Apache 2.0, identical to the source model. This is a derivative work of swiss-ai/Apertus-v1.5-8B; all copyright and attribution notices of the Swiss AI Initiative are retained, and the license and usage-policy files from the source repository are included. Use of this model is subject to the Apertus 1.5 Acceptable Use Policy.
Relationship to the official release
The official swiss-ai checkpoint remains the right choice whenever multimodal input is required. For text-only workloads, this conversion is intended to remain the lighter, tooling-native option — independently of the upstreaming status of apertus1p5. Once huggingface/transformers#47662 is merged, an equivalent text-only extraction can also be produced from the released transformers integration; this repository provides a ready-made, fully documented result.
Acknowledgements
Apertus and Apertus 1.5 are developed by the Swiss AI Initiative (ETH Zurich, EPFL, CSCS) and released under Apache 2.0. This repository is an independent, unofficial conversion and is not affiliated with or endorsed by the Swiss AI Initiative.