Instructions to use teex-pt/AMALIA-9B-0626-DPO-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use teex-pt/AMALIA-9B-0626-DPO-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="teex-pt/AMALIA-9B-0626-DPO-GGUF", filename="AMALIA-9B-0626-DPO-Q4_K_M.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use teex-pt/AMALIA-9B-0626-DPO-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 teex-pt/AMALIA-9B-0626-DPO-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf teex-pt/AMALIA-9B-0626-DPO-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf teex-pt/AMALIA-9B-0626-DPO-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf teex-pt/AMALIA-9B-0626-DPO-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 teex-pt/AMALIA-9B-0626-DPO-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf teex-pt/AMALIA-9B-0626-DPO-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 teex-pt/AMALIA-9B-0626-DPO-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf teex-pt/AMALIA-9B-0626-DPO-GGUF:Q4_K_M
Use Docker
docker model run hf.co/teex-pt/AMALIA-9B-0626-DPO-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use teex-pt/AMALIA-9B-0626-DPO-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "teex-pt/AMALIA-9B-0626-DPO-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": "teex-pt/AMALIA-9B-0626-DPO-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/teex-pt/AMALIA-9B-0626-DPO-GGUF:Q4_K_M
- Ollama
How to use teex-pt/AMALIA-9B-0626-DPO-GGUF with Ollama:
ollama run hf.co/teex-pt/AMALIA-9B-0626-DPO-GGUF:Q4_K_M
- Unsloth Studio
How to use teex-pt/AMALIA-9B-0626-DPO-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 teex-pt/AMALIA-9B-0626-DPO-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 teex-pt/AMALIA-9B-0626-DPO-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for teex-pt/AMALIA-9B-0626-DPO-GGUF to start chatting
- Atomic Chat new
- Docker Model Runner
How to use teex-pt/AMALIA-9B-0626-DPO-GGUF with Docker Model Runner:
docker model run hf.co/teex-pt/AMALIA-9B-0626-DPO-GGUF:Q4_K_M
- Lemonade
How to use teex-pt/AMALIA-9B-0626-DPO-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull teex-pt/AMALIA-9B-0626-DPO-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.AMALIA-9B-0626-DPO-GGUF-Q4_K_M
List all available models
lemonade list
AMALIA-9B-0626-DPO — GGUF
GGUF quantizations of amalia-llm/AMALIA-9B-0626-DPO, the Portuguese (pt-PT) 9B model presented on 1 July 2026. GGUF runs on any platform — Windows, Linux, macOS, NVIDIA/AMD GPUs or plain CPUs — via llama.cpp, Ollama, LM Studio, Jan, and anything built on them.
| File | Quant | Size | Quality (measured) |
|---|---|---|---|
AMALIA-9B-0626-DPO-Q8_0.gguf |
Q8_0 | 9.1 GB | lossless in practice (−0.1% perplexity vs BF16, within noise) |
AMALIA-9B-0626-DPO-Q4_K_M.gguf |
Q4_K_M | 5.2 GB | small loss (+2.7% perplexity vs BF16) |
The chat template is embedded — chat frontends pick it up automatically. Prompt the model in European Portuguese; that is what it is tuned for.
Usage
Ollama — runs straight from this repo, no manual download:
ollama run hf.co/teex-pt/AMALIA-9B-0626-DPO-GGUF:Q4_K_M
# or, for maximum quality:
ollama run hf.co/teex-pt/AMALIA-9B-0626-DPO-GGUF:Q8_0
LM Studio: search for teex-pt/AMALIA-9B-0626-DPO-GGUF and pick a quant.
llama.cpp (pass --jinja so the embedded chat template, including the default system prompt, is fully honored):
llama-cli -m AMALIA-9B-0626-DPO-Q4_K_M.gguf --jinja
Default system prompt
When you don't supply a system message, these builds present the model with a factual identity (extended from the original model's one-liner): Amália, a 9B open-source (Apache 2.0) Portuguese model named after Amália Rodrigues, presented on 1 July 2026 — with an instruction to answer in the user's language (primarily pt-PT) and not to invent details about its origin. Without this, the base model confabulates its identity (we observed invented personas and funding programmes). It is applied via the GGUF-embedded chat template (llama.cpp --jinja, LM Studio) and via the repo's system file (Ollama). Supplying your own system message fully overrides it.
Findings: how quantization affects AMALIA-9B
We converted and benchmarked five variants of this model (GGUF and MLX, 4-bit and 8-bit) on an Apple M5 Pro (48 GB, llama.cpp b9850, mlx-lm 0.31.3). Perplexity for the GGUF family was measured with llama-perplexity over ~16.5k tokens of Portuguese Wikipedia prose, against the BF16 GGUF of the same model:
| Variant | PPL | Δ vs BF16 |
|---|---|---|
| BF16 | 7.779 ± 0.247 | — |
| Q8_0 (this repo) | 7.770 ± 0.247 | −0.1% (noise) |
| Q4_K_M (this repo) | 7.989 ± 0.251 | +2.7% |
Key findings:
- Q8_0 is lossless in practice — its perplexity is statistically identical to full precision. If you have the memory (~10 GB), there is no quality reason to run anything less.
- Q4_K_M is the best 4-bit option we measured — it degrades less (+2.7%) than a plain round-to-nearest 4-bit quantization of the same model (+4.3% in our parallel MLX experiments), thanks to the K-quant mixed-precision layout, at nearly the same size.
- 4-bit is cheap but not free — in greedy side-by-side tests, 4-bit variants showed occasional factual slips absent at 8-bit (e.g. misattributed literary works in a culture question). Fluency, grammar, translation, JSON structure and long-context retrieval (needle at ~2k tokens) were unaffected.
- Speed tracks bytes — generation on an M5 Pro (Metal): Q4_K_M ≈ 48 tok/s, Q8_0 ≈ 30 tok/s, BF16 ≈ 16 tok/s; prompt processing ~1,050 tok/s (
llama-bench, pp512/tg128). On NVIDIA GPUs expect substantially higher.
Rule of thumb: quality-critical work → Q8_0; interactive chat, drafting, or ≤8 GB machines → Q4_K_M.
Conversion pipeline, for reproduction: convert_hf_to_gguf.py (BF16) → llama-quantize (llama.cpp b9850).
Related repos
For native Apple Silicon (MLX) builds with full benchmark data and scripts:
- teex-pt/AMALIA-9B-0626-DPO-MLX-8bit — near-lossless, 30 tok/s
- teex-pt/AMALIA-9B-0626-DPO-MLX-4bit — fastest on Mac, 55+ tok/s
- github.com/teex-pt/pt-amalia — benchmark scripts, conversion pipelines, findings, improvement plan
Attribution
All credit for the model goes to the AMALIA team — these repos are format conversions plus benchmark documentation. Original model: amalia-llm/AMALIA-9B-0626-DPO (Apache 2.0). EuroLLM-based, llama architecture, 32k context.
- Downloads last month
- 73
4-bit
8-bit
Model tree for teex-pt/AMALIA-9B-0626-DPO-GGUF
Base model
amalia-llm/AMALIA-9B-0626-SFT