artok shows you pay more. arabench shows you get less. khalas fixes it.
Same prompt costs 2-5x more in Arabic. Tokenizers fragment Arabic characters into byte sequences, inflating token counts and API bills.
khalas compares Arabic vs English side by side, then optimizes the Arabic prompt to use fewer tokens without losing quality.
pip install khalaskhalas compare "الذكاء الاصطناعي يغير العالم" "AI is changing the world" --provider openai| Command | Description |
|---|---|
compare |
Side-by-side AR vs EN token count and cost |
optimize |
Rewrite Arabic prompt to reduce tokens |
savings |
Show how much you save after optimization |
explain |
Break down where tokens are wasted |
config |
Set default provider and API keys |
| Technique | What it does |
|---|---|
| Language Hint | Prepend language context to guide tokenizer |
| Simplify | Replace complex Arabic structures with simpler equivalents |
| English Backbone | Keep instructions in English, content in Arabic |
| Bilingual Instruction | Mix EN structure with AR key terms |
| Shorten | Remove filler words and redundancy |
| Provider | Model (March 2026) |
|---|---|
| OpenAI | gpt-5.4 |
| Anthropic | claude-opus-4-6 |
| gemini-3.1-pro | |
| DeepSeek | deepseek-v3.2 |
| Mistral | mistral-large-3 |
| Groq | groq-llama-4 |
| Qwen | qwen-3.5 |
| xAI | grok-2 |
مقدمة من مجتمع الذكاء الاصطناعي السعودي للعرب أولا وللعالم أجمع
Brought to you by the Saudi AI Community — for Arabs first, and the world at large.
- artok — Arabic Token Tax Calculator
- bidi-guard — Trojan Source Attack Scanner
- arabench — Arabic LLM Benchmark
- majal — Arabic AI Tools Hub
- khalas — Arabic Prompt Optimizer
MIT — Musa the Carpenter