Instructions to use BoscoTheDog/bitnet_b1_58-xl_q8_0_gguf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use BoscoTheDog/bitnet_b1_58-xl_q8_0_gguf with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="BoscoTheDog/bitnet_b1_58-xl_q8_0_gguf")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("BoscoTheDog/bitnet_b1_58-xl_q8_0_gguf") model = AutoModelForCausalLM.from_pretrained("BoscoTheDog/bitnet_b1_58-xl_q8_0_gguf", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use BoscoTheDog/bitnet_b1_58-xl_q8_0_gguf with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf BoscoTheDog/bitnet_b1_58-xl_q8_0_gguf:F32 # Run inference directly in the terminal: llama cli -hf BoscoTheDog/bitnet_b1_58-xl_q8_0_gguf:F32
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf BoscoTheDog/bitnet_b1_58-xl_q8_0_gguf:F32 # Run inference directly in the terminal: llama cli -hf BoscoTheDog/bitnet_b1_58-xl_q8_0_gguf:F32
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf BoscoTheDog/bitnet_b1_58-xl_q8_0_gguf:F32 # Run inference directly in the terminal: ./build/bin/llama cli -hf BoscoTheDog/bitnet_b1_58-xl_q8_0_gguf:F32
Use Docker
docker model run hf.co/BoscoTheDog/bitnet_b1_58-xl_q8_0_gguf:F32
- Llama new
- LM Studio
- Jan
- vLLM
How to use BoscoTheDog/bitnet_b1_58-xl_q8_0_gguf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "BoscoTheDog/bitnet_b1_58-xl_q8_0_gguf" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "BoscoTheDog/bitnet_b1_58-xl_q8_0_gguf", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/BoscoTheDog/bitnet_b1_58-xl_q8_0_gguf:F32
- SGLang
How to use BoscoTheDog/bitnet_b1_58-xl_q8_0_gguf 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 "BoscoTheDog/bitnet_b1_58-xl_q8_0_gguf" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "BoscoTheDog/bitnet_b1_58-xl_q8_0_gguf", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "BoscoTheDog/bitnet_b1_58-xl_q8_0_gguf" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "BoscoTheDog/bitnet_b1_58-xl_q8_0_gguf", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Ollama
How to use BoscoTheDog/bitnet_b1_58-xl_q8_0_gguf with Ollama:
ollama run hf.co/BoscoTheDog/bitnet_b1_58-xl_q8_0_gguf:F32
- Unsloth Desktop
- Docker Model Runner
How to use BoscoTheDog/bitnet_b1_58-xl_q8_0_gguf with Docker Model Runner:
docker model run hf.co/BoscoTheDog/bitnet_b1_58-xl_q8_0_gguf:F32
- Lemonade
How to use BoscoTheDog/bitnet_b1_58-xl_q8_0_gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull BoscoTheDog/bitnet_b1_58-xl_q8_0_gguf:F32
Run and chat with the model
lemonade run user.bitnet_b1_58-xl_q8_0_gguf-F32
List all available models
lemonade list
- Atomic Chat
This is a reproduction of the BitNet b1.58 paper. The models are trained with RedPajama dataset for 100B tokens. The hypers, as well as two-stage LR and weight decay, are implemented as suggested in their following paper. All models are open-source in the repo. We will train larger models and/or more tokens when resource is available.
Results
PPL and zero-shot accuracy:
| Models | PPL | ARCe | ARCc | HS | BQ | OQ | PQ | WGe | Avg |
|---|---|---|---|---|---|---|---|---|---|
| FP16 700M (reported) | 12.33 | 54.7 | 23.0 | 37.0 | 60.0 | 20.2 | 68.9 | 54.8 | 45.5 |
| BitNet b1.58 700M (reported) | 12.87 | 51.8 | 21.4 | 35.1 | 58.2 | 20.0 | 68.1 | 55.2 | 44.3 |
| BitNet b1.58 700M (reproduced) | 12.78 | 51.4 | 21.8 | 35.0 | 59.6 | 20.6 | 67.5 | 55.4 | 44.5 |
| FP16 1.3B (reported) | 11.25 | 56.9 | 23.5 | 38.5 | 59.1 | 21.6 | 70.0 | 53.9 | 46.2 |
| BitNet b1.58 1.3B (reported) | 11.29 | 54.9 | 24.2 | 37.7 | 56.7 | 19.6 | 68.8 | 55.8 | 45.4 |
| BitNet b1.58 1.3B (reproduced) | 11.19 | 55.8 | 23.7 | 37.6 | 59.0 | 20.2 | 69.2 | 56.0 | 45.9 |
| FP16 3B (reported) | 10.04 | 62.1 | 25.6 | 43.3 | 61.8 | 24.6 | 72.1 | 58.2 | 49.7 |
| BitNet b1.58 3B (reported) | 9.91 | 61.4 | 28.3 | 42.9 | 61.5 | 26.6 | 71.5 | 59.3 | 50.2 |
| BitNet b1.58 3B (reproduced) | 9.88 | 60.9 | 28.0 | 42.3 | 58.3 | 26.0 | 71.4 | 60.3 | 49.6 |
The differences between the reported numbers and the reproduced results are possibly variances from the training data processing, seeds, or other random factors.
Evaluation
You can now run with model with llama.cpp
- Downloads last month
- 467
8-bit
32-bit