Instructions to use QuantFactory/Phi-3.5-mini-ITA-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use QuantFactory/Phi-3.5-mini-ITA-GGUF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="QuantFactory/Phi-3.5-mini-ITA-GGUF") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("QuantFactory/Phi-3.5-mini-ITA-GGUF", dtype="auto") - llama-cpp-python
How to use QuantFactory/Phi-3.5-mini-ITA-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="QuantFactory/Phi-3.5-mini-ITA-GGUF", filename="Phi-3.5-mini-ITA.Q2_K.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 QuantFactory/Phi-3.5-mini-ITA-GGUF with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf QuantFactory/Phi-3.5-mini-ITA-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf QuantFactory/Phi-3.5-mini-ITA-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 QuantFactory/Phi-3.5-mini-ITA-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf QuantFactory/Phi-3.5-mini-ITA-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 QuantFactory/Phi-3.5-mini-ITA-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf QuantFactory/Phi-3.5-mini-ITA-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 QuantFactory/Phi-3.5-mini-ITA-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf QuantFactory/Phi-3.5-mini-ITA-GGUF:Q4_K_M
Use Docker
docker model run hf.co/QuantFactory/Phi-3.5-mini-ITA-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use QuantFactory/Phi-3.5-mini-ITA-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "QuantFactory/Phi-3.5-mini-ITA-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "QuantFactory/Phi-3.5-mini-ITA-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/QuantFactory/Phi-3.5-mini-ITA-GGUF:Q4_K_M
- SGLang
How to use QuantFactory/Phi-3.5-mini-ITA-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 "QuantFactory/Phi-3.5-mini-ITA-GGUF" \ --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": "QuantFactory/Phi-3.5-mini-ITA-GGUF", "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 "QuantFactory/Phi-3.5-mini-ITA-GGUF" \ --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": "QuantFactory/Phi-3.5-mini-ITA-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use QuantFactory/Phi-3.5-mini-ITA-GGUF with Ollama:
ollama run hf.co/QuantFactory/Phi-3.5-mini-ITA-GGUF:Q4_K_M
- Unsloth Studio new
How to use QuantFactory/Phi-3.5-mini-ITA-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 QuantFactory/Phi-3.5-mini-ITA-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 QuantFactory/Phi-3.5-mini-ITA-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for QuantFactory/Phi-3.5-mini-ITA-GGUF to start chatting
- Docker Model Runner
How to use QuantFactory/Phi-3.5-mini-ITA-GGUF with Docker Model Runner:
docker model run hf.co/QuantFactory/Phi-3.5-mini-ITA-GGUF:Q4_K_M
- Lemonade
How to use QuantFactory/Phi-3.5-mini-ITA-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull QuantFactory/Phi-3.5-mini-ITA-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.Phi-3.5-mini-ITA-GGUF-Q4_K_M
List all available models
lemonade list
QuantFactory/Phi-3.5-mini-ITA-GGUF
This is quantized version of anakin87/Phi-3.5-mini-ITA created using llama.cpp
Original Model Card

Phi-3.5-mini-ITA
Fine-tuned version of Microsoft/Phi-3.5-mini-instruct optimized for better performance in Italian.
- Small yet powerful model with 3.82 billion parameters
- Supports 128k context length
💬🇮🇹 Chat with the model on Hugging Face Spaces
🏆 Evaluation
| Model | Parameters | Average | MMLU_IT | ARC_IT | HELLASWAG_IT |
|---|---|---|---|---|---|
| anakin87/Phi-3.5-mini-ITA | 3.82 B | 57.67 | 59.93 | 51.5 | 61.57 |
| meta-llama/Meta-Llama-3.1-8B-Instruct | 8.03 B | 56.97 | 58.43 | 48.42 | 64.07 |
| microsoft/Phi-3.5-mini-instruct | 3.82 B | 56.82 | 60.03 | 49.19 | 61.25 |
For a detailed comparison of model performance, check out the Leaderboard for Italian Language Models.
🎮 Model in action
Demo
💬🇮🇹 Chat with the model on Hugging Face Spaces
Text generation with Transformers
The model is small, so it runs smoothly on Colab. It is also fine to load the model using quantization.
With transformers==4.44.2, trust_remote_code=True is needed to incorporate a minor bug fix in Phi3ForCausalLM.
Read this discussion for more details.
⚡ The model is compatible with Flash Attention 2, which accelerates inference. To enable it, uncomment the attn_implementation parameter in the code snippet below.
# pip install transformers accelerate
import torch
from transformers import pipeline
model_id="anakin87/Phi-3.5-mini-ITA"
model = AutoModelForCausalLM.from_pretrained(
model_id,
device_map="auto",
torch_dtype=torch.bfloat16,
trust_remote_code=True,
# attn_implementation="flash_attention_2", # UNCOMMENT TO USE FLASH ATTENTION 2
)
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
user_input = "Puoi spiegarmi brevemente la differenza tra imperfetto e passato prossimo in italiano e quando si usano?"
messages = [{"role": "user", "content": user_input}]
outputs = pipe(prompt, max_new_tokens=500, do_sample=True, temperature=0.001)
print(outputs[0]["generated_text"])
Example output:
Certamente! Imperfetto e passato prossimo sono due tempi verbali in italiano che si riferiscono a azioni passate, ma hanno sfumature diverse.
Imperfetto:
- L'imperfetto è usato per descrivere azioni o situazioni passate che erano continue o ripetute nel tempo.
- Indica un'azione senza una fine specifica o un'azione che si svolgeva abitualmente.
- È spesso usato per descrivere situazioni, condizioni o stati passati.
- Esempio: "Quando ero bambino, giocavo spesso nel parco."
Passato Prossimo:
- Il passato prossimo è usato per descrivere azioni passate che sono state completate o che hanno avuto una durata specifica.
- Indica un'azione che è avvenuta in un momento specifico nel passato.
- È spesso usato per descrivere eventi o azioni che hanno una durata definita o che si sono svolte in un momento specifico.
- Esempio: "Ieri ho finito il libro."
In sintesi, l'imperfetto si usa per azioni continue o abituali nel passato, mentre il passato prossimo si usa per azioni completate o avvenute in un momento specifico nel passato.
Build AI applications
You can use the model to create a variety of AI applications.
I recommend using the 🏗️ Haystack LLM framework for orchestration. (spoiler: I work on it and it is open-source 😄)
This model is compatible with HuggingFaceLocalGenerator and HuggingFaceLocalChatGenerator components.
You can also deploy the model with a TGI container and then use it with HuggingFaceAPIGenerator and the related Chat Generator.
Some examples you can keep inspiration from:
🔧 Training details
This model was fine-tuned using HF TRL. It underwent 2 epochs of instruction fine-tuning on the FineTome-100k and Capybara-Claude-15k-ita datasets. 🙏 Thanks to the authors for providing these datasets.
I adopted a relatively new technique for parameter-efficient learning: Spectrum. The idea is to train only the layers of the model with high Signal-to-Noise Ratio (SNR) and ❄️ freeze the rest.
Training required about 14 hours on a single A40 GPU.
I may release a guide/tutorial soon. Stay tuned! 📻
- Downloads last month
- 258
2-bit
3-bit
4-bit
5-bit
6-bit
8-bit
Model tree for QuantFactory/Phi-3.5-mini-ITA-GGUF
Base model
microsoft/Phi-3.5-mini-instruct