Instructions to use cybertronak/safecompress-tinyaya-consensus5-fp16prot-nf4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cybertronak/safecompress-tinyaya-consensus5-fp16prot-nf4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="cybertronak/safecompress-tinyaya-consensus5-fp16prot-nf4") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("cybertronak/safecompress-tinyaya-consensus5-fp16prot-nf4") model = AutoModelForCausalLM.from_pretrained("cybertronak/safecompress-tinyaya-consensus5-fp16prot-nf4", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use cybertronak/safecompress-tinyaya-consensus5-fp16prot-nf4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cybertronak/safecompress-tinyaya-consensus5-fp16prot-nf4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cybertronak/safecompress-tinyaya-consensus5-fp16prot-nf4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/cybertronak/safecompress-tinyaya-consensus5-fp16prot-nf4
- SGLang
How to use cybertronak/safecompress-tinyaya-consensus5-fp16prot-nf4 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 "cybertronak/safecompress-tinyaya-consensus5-fp16prot-nf4" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cybertronak/safecompress-tinyaya-consensus5-fp16prot-nf4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "cybertronak/safecompress-tinyaya-consensus5-fp16prot-nf4" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cybertronak/safecompress-tinyaya-consensus5-fp16prot-nf4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use cybertronak/safecompress-tinyaya-consensus5-fp16prot-nf4 with Docker Model Runner:
docker model run hf.co/cybertronak/safecompress-tinyaya-consensus5-fp16prot-nf4
safecompress-tinyaya-consensus5-fp16prot-nf4
Safety-aware compression of Tiny Aya Global (SafeCompress). Decoder layers [0, 7, 14, 16, 35] are kept in FP16; all other layers are quantized to NF4.
| FP16 (reference) | uniform 4-bit | this model | |
|---|---|---|---|
| harmful-prompt refusal (EN+HI, 200 prompts, phrase matcher) | 0.655 | 0.605 | 0.660 (95% CI 0.595-0.725) |
| first-token refusal gap on harmful prompts (logits) | 1.86 | 1.69 | 2.29 |
| Global-MMLU EN+HI accuracy | 0.475 | 0.457 | 0.462 |
| Belebele EN+HI accuracy | 0.770 | 0.760 | 0.755 |
| benign-prompt refusal | 0.025 | 0.010 | 0.020 |
| GPU memory (GB) | 6.70 | 2.53 | 3.10 |
Load: AutoModelForCausalLM.from_pretrained("cybertronak/safecompress-tinyaya-consensus5-fp16prot-nf4", device_map="auto") (needs bitsandbytes and a CUDA GPU). You must have accepted the base model's terms.
Limitations: 200 harmful and 200 benign prompts, refusal measured with a phrase matcher plus the first-token gap (no judge model), one model, one quantizer family. Differences between protected-layer selections are within overlapping confidence intervals.
- Downloads last month
- 14