Instructions to use MiguelOli/AMALIA-9B-0626-DPO-mlx-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use MiguelOli/AMALIA-9B-0626-DPO-mlx-4bit with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("MiguelOli/AMALIA-9B-0626-DPO-mlx-4bit") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- MLX LM
How to use MiguelOli/AMALIA-9B-0626-DPO-mlx-4bit with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "MiguelOli/AMALIA-9B-0626-DPO-mlx-4bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "MiguelOli/AMALIA-9B-0626-DPO-mlx-4bit" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MiguelOli/AMALIA-9B-0626-DPO-mlx-4bit", "messages": [ {"role": "user", "content": "Hello"} ] }'
AMALIA-9B-0626-DPO — MLX 4-bit
MLX (Apple Silicon–native format) conversion of
amalia-llm/AMALIA-9B-0626-DPO,
the open LLM for European Portuguese (pt-PT) developed by NOVA, IST, IT and FCT
(PROPOR 2026).
This is the DPO variant (instruct + preference alignment) — the most polished model in the family. Quantized to 4-bit to run fast and light on M1/M2/M3/M4 Macs.
Why this repo: at conversion time there was an MLX build only of the SFT variant (dgomes03) and a GGUF of the DPO variant (duarteocarmo), but no MLX build of the DPO variant. This repo fills that gap.
Usage
pip install mlx-lm
from mlx_lm import load, generate
model, tokenizer = load("MiguelOli/AMALIA-9B-0626-DPO-mlx-4bit")
messages = [{"role": "user", "content": "Explica-me o que é o fado, em português de Portugal."}]
prompt = tokenizer.apply_chat_template(messages, add_generation_prompt=True)
response = generate(model, tokenizer, prompt=prompt, max_tokens=512, verbose=True)
Or from the command line:
mlx_lm.generate --model MiguelOli/AMALIA-9B-0626-DPO-mlx-4bit \
--prompt "Qual a diferença entre 'está-se' e 'está a ser' em pt-PT?"
Conversion details
| Base model | amalia-llm/AMALIA-9B-0626-DPO (9B, EuroLLM-9B continued pretraining + SFT + DPO) |
| Quantization | 4-bit (4.5 bits/weight, default group size of mlx_lm.convert) |
| Tool | mlx-lm 0.31.3 (mlx_lm.convert --hf-path ... -q --q-bits 4) |
| Context | 32K tokens |
| License | Apache-2.0 (inherited from the base model) |
Tested on a Mac M4: ~18.75 tokens/sec generation, ~5.4 GB peak memory.
Usage tip
AMÁLIA's strength is authentic European Portuguese (phonetics, orthography, idioms, pt-PT vs pt-BR bias). Talk to it in pt-PT to get the most out of it. It is not the strongest model on raw factual knowledge — it is a 9B focused on the variant.
Credits
- Original model: the AMALIA project — NOVA, NOVA LINCS, Instituto de Telecomunicações, Instituto Superior Técnico, FCT. (amalia-llm)
- MLX conversion: this repo.
- Downloads last month
- 18
4-bit
Model tree for MiguelOli/AMALIA-9B-0626-DPO-mlx-4bit
Base model
amalia-llm/AMALIA-9B-0626-SFT