Instructions to use shefowl/Aion-1.0-Instruct-2.3B-Polish with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use shefowl/Aion-1.0-Instruct-2.3B-Polish with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="shefowl/Aion-1.0-Instruct-2.3B-Polish", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("shefowl/Aion-1.0-Instruct-2.3B-Polish", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use shefowl/Aion-1.0-Instruct-2.3B-Polish with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "shefowl/Aion-1.0-Instruct-2.3B-Polish" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "shefowl/Aion-1.0-Instruct-2.3B-Polish", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/shefowl/Aion-1.0-Instruct-2.3B-Polish
- SGLang
How to use shefowl/Aion-1.0-Instruct-2.3B-Polish 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 "shefowl/Aion-1.0-Instruct-2.3B-Polish" \ --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": "shefowl/Aion-1.0-Instruct-2.3B-Polish", "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 "shefowl/Aion-1.0-Instruct-2.3B-Polish" \ --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": "shefowl/Aion-1.0-Instruct-2.3B-Polish", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use shefowl/Aion-1.0-Instruct-2.3B-Polish with Docker Model Runner:
docker model run hf.co/shefowl/Aion-1.0-Instruct-2.3B-Polish
Aion-1.0-Instruct-2.3B-Polish
Microsoft Aion-1.0-Instruct-2.3B does not officially support Polish: it understands it but writes it badly. This is a research adaptation: 190M tokens of Polish continued pretraining, SFT on judged synthetic data and one round of SFT on the model's own answers corrected by a stronger model. Unofficial, not affiliated with Microsoft.
Results
polish-writing-eval, 456 everyday writing prompts, greedy decoding, judge DeepSeek V4.1 Flash. Lower errors are better; 95% bootstrap interval over prompts.
| model | language errors / 100 words | fluency 1–5 | task 1–5 | loops |
|---|---|---|---|---|
| Mistral Small 4 | 1.03 | 4.29 | 4.20 | 1% |
| Ministral 8B | 1.63 | 3.46 | 3.53 | 4% |
| this model | 2.48 (2.27–2.71) | 3.05 | 2.80 | 28% |
| Ministral 3B | 2.81 | 2.88 | 2.93 | 8% |
| Aion 2.3B, original | 5.35 ¹ | 1.88 ¹ | 1.79 ¹ | 37% ¹ |
¹ core 116 prompts. For calibration, original Aion writes German, a supported language, at 1.96 errors / 100 words and fluency 3.52.
FLORES-200 devtest, nats per passage relative to English (how much more expensive Polish is for the model than the same text in English): original 1.72 → this model 1.36. Supported languages of the base model sit at 1.12–1.30.
Recipe
| step | data | result (errors / 100 words) |
|---|---|---|
| SFT only, no pretraining | polish-sft-synthetic sft + 2.9k English rows |
4.40 |
| CPT 98M tokens, then the same SFT | FineWeb-2 Polish 85% + FineWeb-Edu English 15% | 3.16 |
| CPT +92M tokens, then the same SFT | Polish DynaWord, resampled toward conversation, speech and literature | 2.94 |
| + SFT on own corrected answers | 3,000 own answers fixed with minimal edits (corrections, round 3) |
2.48 |
CPT: full model except embeddings, LR 2e-5 cosine, 65k tokens per step, sequence 2048. SFT: full model, 2 epochs, LR 1e-5. Correction SFT: LR 5e-6, the fixes plus 1,500 replay rows.
What we learned on the way:
- Continued pretraining is necessary. SFT alone barely moves the language (FLORES 1.72 → 1.68); the first 98M CPT tokens cut writing errors by 28%.
- Returns fall fast. The second 92M tokens gave −0.24 errors / 100 words, not significant (paired interval −0.56 to +0.10); the first gave −1.23.
- Self-correction is the cheapest lever: about $0.5 of API calls per round, −0.84 on the 98M model and −0.43 on this one. A second round on top plateaued.
- DPO on the same pairs was weaker than SFT on the fixes (the chosen answers' log-probability fell by 20 nats).
- Loops come from greedy decoding. Repetition penalty 1.1 halves them (28% → 12%) but raises errors to 3.10; sampling and n-gram blocking are worse.
Usage
The model uses the base model's custom code (trust_remote_code=True) and its tokenizer and chat template.
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
m = "shefowl/Aion-1.0-Instruct-2.3B-Polish"
tok = AutoTokenizer.from_pretrained(m, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(m, trust_remote_code=True, dtype=torch.bfloat16).to("cuda" if torch.cuda.is_available() else "cpu")
msgs = [{"role": "user", "content": "Napisz krótką wiadomość do sąsiada z prośbą o przyciszenie muzyki po 22."}]
x = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt", return_dict=True).to(model.device)
y = model.generate(**x, max_new_tokens=500, do_sample=False)
print(tok.decode(y[0, x["input_ids"].shape[1]:], skip_special_tokens=True))
GGUF files for llama.cpp (Q8_0 to Q4_K_M, Polish importance matrix; they need llama.cpp with an Aion port) are in Aion-1.0-Instruct-2.3B-Polish-GGUF.
Limitations
- Still makes grammar errors, about one in 40 words; the vocative is a common one (Szanowny Panie Tomasz instead of Tomaszu).
- Loops in about a quarter of answers with greedy decoding; keep
max_new_tokensmodest. - Facts are weak, as in the base model at this size.
- No extra safety tuning beyond the base model's. A research artifact, not a product.
License
MIT, as the base model. Training data: FineWeb-2 and FineWeb-Edu (ODC-By), Polish DynaWord (per-document source licenses), JohnTdi/polish-llm-sft-en (Apache 2.0) and our synthetic data (CC BY 4.0).
- Downloads last month
- 59