Instructions to use de-coder/UlizaLlama_Q4_K_M-gguf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use de-coder/UlizaLlama_Q4_K_M-gguf with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="de-coder/UlizaLlama_Q4_K_M-gguf")# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("de-coder/UlizaLlama_Q4_K_M-gguf") model = AutoModelForMultimodalLM.from_pretrained("de-coder/UlizaLlama_Q4_K_M-gguf") - llama-cpp-python
How to use de-coder/UlizaLlama_Q4_K_M-gguf with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="de-coder/UlizaLlama_Q4_K_M-gguf", filename="Q4_K_M.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use de-coder/UlizaLlama_Q4_K_M-gguf with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf de-coder/UlizaLlama_Q4_K_M-gguf:Q4_K_M # Run inference directly in the terminal: llama-cli -hf de-coder/UlizaLlama_Q4_K_M-gguf:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf de-coder/UlizaLlama_Q4_K_M-gguf:Q4_K_M # Run inference directly in the terminal: llama-cli -hf de-coder/UlizaLlama_Q4_K_M-gguf:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf de-coder/UlizaLlama_Q4_K_M-gguf:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf de-coder/UlizaLlama_Q4_K_M-gguf:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf de-coder/UlizaLlama_Q4_K_M-gguf:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf de-coder/UlizaLlama_Q4_K_M-gguf:Q4_K_M
Use Docker
docker model run hf.co/de-coder/UlizaLlama_Q4_K_M-gguf:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use de-coder/UlizaLlama_Q4_K_M-gguf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "de-coder/UlizaLlama_Q4_K_M-gguf" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "de-coder/UlizaLlama_Q4_K_M-gguf", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/de-coder/UlizaLlama_Q4_K_M-gguf:Q4_K_M
- SGLang
How to use de-coder/UlizaLlama_Q4_K_M-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 "de-coder/UlizaLlama_Q4_K_M-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": "de-coder/UlizaLlama_Q4_K_M-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 "de-coder/UlizaLlama_Q4_K_M-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": "de-coder/UlizaLlama_Q4_K_M-gguf", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Ollama
How to use de-coder/UlizaLlama_Q4_K_M-gguf with Ollama:
ollama run hf.co/de-coder/UlizaLlama_Q4_K_M-gguf:Q4_K_M
- Unsloth Studio
How to use de-coder/UlizaLlama_Q4_K_M-gguf with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for de-coder/UlizaLlama_Q4_K_M-gguf to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for de-coder/UlizaLlama_Q4_K_M-gguf to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for de-coder/UlizaLlama_Q4_K_M-gguf to start chatting
- Atomic Chat new
- Docker Model Runner
How to use de-coder/UlizaLlama_Q4_K_M-gguf with Docker Model Runner:
docker model run hf.co/de-coder/UlizaLlama_Q4_K_M-gguf:Q4_K_M
- Lemonade
How to use de-coder/UlizaLlama_Q4_K_M-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull de-coder/UlizaLlama_Q4_K_M-gguf:Q4_K_M
Run and chat with the model
lemonade run user.UlizaLlama_Q4_K_M-gguf-Q4_K_M
List all available models
lemonade list
output = llm(
"Once upon a time,",
max_tokens=512,
echo=True
)
print(output)UlizaLlama_Q4_K_M-gguf 4-bit Quantized Bilingual Language Model
Overview
UlizaLlama_Q4_K_M-gguf is a 4-bit quantized version of the UlizaLlama model, a 7B parameter language model fine-tuned for Swahili and English. This quantized model offers the same bilingual capabilities as the original UlizaLlama but with significantly reduced model size and improved inference speed, making it ideal for deployment in resource-constrained environments.
Key Features
- Bilingual Proficiency: Excels in both Swahili and English, with a focus on instructional tasks.
- 4-bit Quantization: Utilizes the QQUF (Quantized QUarter Float) format for a 75% reduction in model size.
- Efficient Inference: Faster processing and lower memory footprint compared to the full-precision model.
- Versatile Applications: Suitable for question-answering, chat assistants, and various domain-specific tasks.
Model Details
- Original Model: UlizaLlama (7B parameters)
- Base Model: Jacaranda/kiswallama-pretrained (derived from Meta/Llama2)
- Quantization Method: 4-bit QQUF
- Languages: Swahili and English
- License: CC BY-NC-SA 4.0 DEED
Installation
To use UlizaLlama-QQUF, you'll need a library that supports 4-bit quantized models. We recommend using the bitsandbytes library:
!pip install ctransformers
Usage
Here's a simple example of how to load and use de-coder/UlizaLlama_Q4_K_M-gguf
from ctransformers import AutoModelForCausalLM
# Load the model
llm = AutoModelForCausalLM.from_pretrained(
"de-coder/UlizaLlama_Q4_K_M-gguf",
model_file="Q4_K_M.gguf",
lib="avx2" # or "basic" if avx2 isn't supported
)
# Generate text
prompt = "Niambie kuhusu historia ya Kilimanjaro."
print(llm(prompt))
Performance and Trade-offs
UlizaLlama-QQUF offers substantial improvements in model size and inference speed. However, there might be a slight degradation in performance compared to the full-precision model. We encourage users to benchmark the model on their specific tasks to understand these trade-offs.
Use Cases
- Chatbots for healthcare, agriculture, education, and more.
- Language learning applications.
- Information services in Swahili-speaking regions.
- Edge devices and mobile applications.
Citation and Acknowledgments
If you use UlizaLlama_Q4_K_M-gguf in your work, please cite:
@misc{UlizaLlama_Q4_K_M-gguf,
title={UlizaLlama_Q4_K_M-gguf: A Bilingual Language Model for Swahili and English},
author={Kelvin Githu(de-coder)},
year={2024},
publisher={Kelvin Githu},
howpublished={\url{https://huggingface.co/de-coder/UlizaLlama_Q4_K_M-gguf}},
}
- Downloads last month
- 25
4-bit
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="de-coder/UlizaLlama_Q4_K_M-gguf", filename="Q4_K_M.gguf", )