artok shows you pay more. arabench shows you get less. khalas fixes it.
10 techniques · 8 providers · instant savings
$pip install khalas
Chapter I
Same Prompt, Different Price
Arabic prompts cost 2-5x more. Tokenizers split Arabic into byte fragments. Same meaning, inflated bill.
Arabic
اكتب لي ملخصا عن الذكاء الاصطناعي
34
tokens
English
Write me a summary about AI
7
tokens
After khalas optimize
12
tokens · 65% saved
Chapter II
5 Optimization Techniques
Each technique reduces tokens differently. khalas picks the best combination.
Language Hint Prepend language context to guide the tokenizer into Arabic-aware mode.
Simplify Replace complex Arabic morphology with simpler equivalents. Same meaning, fewer fragments.
English Backbone Keep instructions in English, content in Arabic. Tokenizers handle the split cheaply.
Bilingual Instruction Mix English structure with Arabic key terms. Best of both token economies.
Shorten Remove filler words, redundancy, and verbose honorifics. Direct and cheap.
Chapter III
8 Providers
March 2026 models. All major providers supported.
Provider
Model
Input $/1M
Output $/1M
OpenAI
gpt-5.4
$2.50
$10.00
Anthropic
claude-opus-4-6
$5.00
$25.00
Google
gemini-3.1-pro
$1.25
$10.00
DeepSeek
deepseek-v3.2
$0.27
$1.10
Mistral
mistral-large-3
$0.50
$1.50
Groq
groq-llama-4
$0.06
$0.06
Qwen
qwen-3.5
$0.10
$0.40
xAI
grok-2
$2.00
$10.00
Chapter IV
5 Commands
Zero waste.
compare Side-by-side AR vs EN token count and cost
optimize Rewrite Arabic prompt to use fewer tokens
savings Show tokens and dollars saved after optimization
explain Break down where tokens are wasted
config Set default provider and API keys
Chapter V
Get Started
# Install$ pip install khalas# Compare AR vs EN$ khalas compare "اكتب ملخصا عن الذكاء الاصطناعي" "Write a summary about AI" --provider openai# Optimize the Arabic prompt$ khalas optimize "اكتب لي ملخصا مفصلا وشاملا عن موضوع الذكاء الاصطناعي" --provider anthropic# See your savings$ khalas savings --last# Explain where tokens are wasted$ khalas explain "اكتب لي ملخصا مفصلا وشاملا عن موضوع الذكاء الاصطناعي"