Access Apertus 1.5 8B (text-only conversion)

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

By clicking below you confirm that you have read and agree to the Apache License 2.0 and the Apertus 1.5 Acceptable Use Policy (https://github.com/swiss-ai/apertus-legal/blob/main/apertus_1.5/USAGE_POLICY.pdf). Access is granted automatically and immediately.

Log in or Sign Up to review the conditions and access this model content.

Apertus 1.5 8B — Text-Only Conversion

A text-only derivative of swiss-ai/Apertus-v1.5-8B (Swiss AI Initiative: ETH Zurich / EPFL / CSCS), repackaged as a standard, lightweight apertus checkpoint (ApertusForCausalLM).

The checkpoint loads with release transformers >= 4.56 — no fork, no trust_remote_code — and is compatible with Unsloth, vLLM, llama.cpp/GGUF, MLX, and LM Studio.

Access is gated with automatic approval, mirroring the license-acceptance step of the source repository.

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

Transformers

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.

Tool calling

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.

# 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 Text-only scope; smaller, dependency-free artifact
5 Embedding table truncated from 266,752 to 131,272 rows Multimodal code rows are unused in text-only operation
6 config.json rewritten: model_type: apertus, vocab_size: 131,272, tie_word_embeddings: false Compatibility with release transformers
7 RoPE written in both formats: nested rope_parameters (transformers v5) and flat rope_theta/rope_scaling (legacy loaders, incl. Unsloth) Loader compatibility; identical values
8 Tokenizer added tokens trimmed to ids < 131,272 GGUF/llama.cpp requires max token id < vocab_size
9 Tokenizer eos_token set to `< assistant_end
10 Chat template embedded inline in tokenizer_config.json; chat_template.jinja retained unchanged GGUF converters do not read separate template files
11 model.yaml added LM Studio metadata (reasoning, tool use, thinking toggle)

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.

Downloads last month
144
Safetensors
Model size
8B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for andreasmartin/apertus-v1.5-8b-text

Finetuned
(3)
this model
Finetunes
1 model
Quantizations
1 model

Space using andreasmartin/apertus-v1.5-8b-text 1