Instructions to use MoxoffSrL/AzzurroQuantized with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MoxoffSrL/AzzurroQuantized with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MoxoffSrL/AzzurroQuantized") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("MoxoffSrL/AzzurroQuantized") model = AutoModelForCausalLM.from_pretrained("MoxoffSrL/AzzurroQuantized") - llama-cpp-python
How to use MoxoffSrL/AzzurroQuantized with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="MoxoffSrL/AzzurroQuantized", filename="Azzurro-ggml-Q4_K_M.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use MoxoffSrL/AzzurroQuantized with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf MoxoffSrL/AzzurroQuantized:Q4_K_M # Run inference directly in the terminal: llama-cli -hf MoxoffSrL/AzzurroQuantized:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf MoxoffSrL/AzzurroQuantized:Q4_K_M # Run inference directly in the terminal: llama-cli -hf MoxoffSrL/AzzurroQuantized: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 MoxoffSrL/AzzurroQuantized:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf MoxoffSrL/AzzurroQuantized: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 MoxoffSrL/AzzurroQuantized:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf MoxoffSrL/AzzurroQuantized:Q4_K_M
Use Docker
docker model run hf.co/MoxoffSrL/AzzurroQuantized:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use MoxoffSrL/AzzurroQuantized with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MoxoffSrL/AzzurroQuantized" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MoxoffSrL/AzzurroQuantized", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/MoxoffSrL/AzzurroQuantized:Q4_K_M
- SGLang
How to use MoxoffSrL/AzzurroQuantized 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 "MoxoffSrL/AzzurroQuantized" \ --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": "MoxoffSrL/AzzurroQuantized", "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 "MoxoffSrL/AzzurroQuantized" \ --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": "MoxoffSrL/AzzurroQuantized", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use MoxoffSrL/AzzurroQuantized with Ollama:
ollama run hf.co/MoxoffSrL/AzzurroQuantized:Q4_K_M
- Unsloth Studio new
How to use MoxoffSrL/AzzurroQuantized 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 MoxoffSrL/AzzurroQuantized 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 MoxoffSrL/AzzurroQuantized to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for MoxoffSrL/AzzurroQuantized to start chatting
- Docker Model Runner
How to use MoxoffSrL/AzzurroQuantized with Docker Model Runner:
docker model run hf.co/MoxoffSrL/AzzurroQuantized:Q4_K_M
- Lemonade
How to use MoxoffSrL/AzzurroQuantized with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull MoxoffSrL/AzzurroQuantized:Q4_K_M
Run and chat with the model
lemonade run user.AzzurroQuantized-Q4_K_M
List all available models
lemonade list
Install from WinGet (Windows)
winget install llama.cpp
# Start a local OpenAI-compatible server with a web UI:
llama-server -hf MoxoffSrL/AzzurroQuantized:Q4_K_M# Run inference directly in the terminal:
llama-cli -hf MoxoffSrL/AzzurroQuantized:Q4_K_MUse 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 MoxoffSrL/AzzurroQuantized:Q4_K_M# Run inference directly in the terminal:
./llama-cli -hf MoxoffSrL/AzzurroQuantized:Q4_K_MBuild 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 MoxoffSrL/AzzurroQuantized:Q4_K_M# Run inference directly in the terminal:
./build/bin/llama-cli -hf MoxoffSrL/AzzurroQuantized:Q4_K_MUse Docker
docker model run hf.co/MoxoffSrL/AzzurroQuantized:Q4_K_MModel Information
AzzurroQuantized is a compact iteration of the model Azzurro, optimized for efficiency.
It is offered in two distinct configurations: a 4-bit version and an 8-bit version, each designed to maintain the model's effectiveness while significantly reducing its size and computational requirements.
- It's trained both on publicly available datasets, like SQUAD-it, and datasets we've created in-house.
- it's designed to understand and maintain context, making it ideal for Retrieval Augmented Generation (RAG) tasks and applications requiring contextual awareness.
- It is quantized in a 4-bit version and an 8-bit version following the procedure here.
Evaluation
We evaluated the model using the same test sets as used for the Open Ita LLM Leaderboard:
| hellaswag_it acc_norm | arc_it acc_norm | m_mmlu_it 5-shot acc | Average |
|---|---|---|---|
| 0.6067 | 0.4405 | 0.5112 | 0,52 |
Usage
You need to download the .gguf model first
If you want to use the cpu install these dependencies:
pip install llama-cpp-python huggingface_hub
If you want to use the gpu instead:
CMAKE_ARGS="-DLLAMA_CUBLAS=on" pip install huggingface_hub llama-cpp-python --force-reinstall --upgrade --no-cache-dir
And then use this code to see a response to the prompt.
from huggingface_hub import hf_hub_download
from llama_cpp import Llama
model_path = hf_hub_download(
repo_id="MoxoffSpA/AzzurroQuantized",
filename="Azzurro-ggml-Q4_K_M.gguf"
)
# Set gpu_layers to the number of layers to offload to GPU. Set to 0 if no GPU acceleration is available on your system.
llm = Llama(
model_path=model_path,
n_ctx=2048, # The max sequence length to use - note that longer sequence lengths require much more resources
n_threads=8, # The number of CPU threads to use, tailor to your system and the resulting performance
n_gpu_layers=0 # The number of layers to offload to GPU, if you have GPU acceleration available
)
# Simple inference example
question = """Quanto è alta la torre di Pisa?"""
context = """
La Torre di Pisa è un campanile del XII secolo, famoso per la sua inclinazione. Alta circa 56 metri.
"""
prompt = f"Domanda: {question}, contesto: {context}"
output = llm(
f"[INST] {prompt} [/INST]", # Prompt
max_tokens=128,
stop=["\n"],
echo=True,
temperature=0.1,
top_p=0.95
)
# Chat Completion API
print(output['choices'][0]['text'])
Bias, Risks and Limitations
AzzurroQuantized and its original model Azzurro have not been aligned to human preferences for safety within the RLHF phase or deployed with in-the-loop filtering of responses like ChatGPT, so the model can produce problematic outputs (especially when prompted to do so). It is also unknown what the size and composition of the corpus were used to train the base model mistralai/Mistral-7B-v0.2, however, it is likely to have included a mix of Web data and technical sources like books and code.
Links to resources
- SQUAD-it dataset: https://huggingface.co/datasets/squad_it
- Mistral_7B_v0.2 original weights: https://models.mistralcdn.com/mistral-7b-v0-2/mistral-7B-v0.2.tar
- Mistral_7B_v0.2 model: https://huggingface.co/alpindale/Mistral-7B-v0.2-hf
- Open Ita LLM Leaderbord: https://huggingface.co/spaces/FinancialSupport/open_ita_llm_leaderboard
Base version
We have the not quantized version here: https://huggingface.co/MoxoffSpA/Azzurro
The Moxoff Team
Jacopo Abate, Marco D'Ambra, Luigi Simeone, Gianpaolo Francesco Trotta
- Downloads last month
- 18
4-bit
8-bit
Install from brew
# Start a local OpenAI-compatible server with a web UI: llama-server -hf MoxoffSrL/AzzurroQuantized:Q4_K_M# Run inference directly in the terminal: llama-cli -hf MoxoffSrL/AzzurroQuantized:Q4_K_M