bitsandbytes quantizations of
Zyphra/ZAYA1-8B.
ZAYA1-8B excels at detailed long-form reasoning, especially for mathematical and coding tasks. Due to its small total parameter count, it can also be deployed on-device for local LLM applications.
1# NF4 (4-bit) — recommended
2huggingface-cli download barozp/ZAYA1-8B-BNB --include "NF4/*" --local-dir ./ZAYA1-8B-NF4
3
4# NF4 with double quantization
5huggingface-cli download barozp/ZAYA1-8B-BNB --include "NF4-DQ/*" --local-dir ./ZAYA1-8B-NF4-DQ
6
7# INT8 (8-bit)
8huggingface-cli download barozp/ZAYA1-8B-BNB --include "INT8/*" --local-dir ./ZAYA1-8B-INT8
1pip install "transformers @ git+https://github.com/Zyphra/transformers.git@zaya1"
2pip install bitsandbytes>=0.43.0 accelerate
1from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
2import torch
3
4bnb_config = BitsAndBytesConfig(
5 load_in_4bit=True,
6 bnb_4bit_quant_type="nf4",
7 bnb_4bit_compute_dtype=torch.bfloat16,
8)
9
10tokenizer = AutoTokenizer.from_pretrained("barozp/ZAYA1-8B-BNB", subfolder="NF4",
11 trust_remote_code=True)
12model = AutoModelForCausalLM.from_pretrained("barozp/ZAYA1-8B-BNB", subfolder="NF4",
13 quantization_config=bnb_config,
14 device_map="auto",
15 trust_remote_code=True)
1bnb_config = BitsAndBytesConfig(load_in_8bit=True)
2
3tokenizer = AutoTokenizer.from_pretrained("barozp/ZAYA1-8B-BNB", subfolder="INT8",
4 trust_remote_code=True)
5model = AutoModelForCausalLM.from_pretrained("barozp/ZAYA1-8B-BNB", subfolder="INT8",
6 quantization_config=bnb_config,
7 device_map="auto",
8 trust_remote_code=True)
1messages = [
2 {"role": "system", "content": "You are a helpful assistant."},
3 {"role": "user", "content": "What is the sum of the first 100 prime numbers?"},
4]
5
6input_ids = tokenizer.apply_chat_template(messages, return_tensors="pt").to(model.device)
7output = model.generate(input_ids, max_new_tokens=512)
8print(tokenizer.decode(output[0][input_ids.shape[-1]:], skip_special_tokens=True))
1# vLLM (recommended for serving)
2pip install "vllm @ git+https://github.com/Zyphra/vllm.git@zaya1"
3
4# Transformers
5pip install "transformers @ git+https://github.com/Zyphra/transformers.git@zaya1"
Apache 2.0 — same as the original model.