
Entrepreneur | Building AI products to serve at scale. https://nitter.cf/t.co/tCsvooLyuZ, https://nitter.cf/t.co/NrzEaDNo3E. Persian Acct: @mehdiAllahyari
Atlanta, USA
Joined October 2025
- Tweets66
- Following46
- Followers309
- Likes16
Pinned Tweet
A real-time speech recognition model for Persian (Farsi), open weights
NVIDIA’s Nemotron 3.5 streaming ASR model covers many languages, but not Persian. So I fine-tuned it on 1,181 hours of openly licensed Persian speech, and I’m releasing the model and the code.
To my knowledge, it’s the most accurate open-source Persian ASR model: 8.8% WER on FLEURS, vs 10.6% for Shenava, the strongest open Persian model so far.
- Live transcription as you speak, with 0.3–1.1 s of look-ahead; it handles whole audio and video files too
- FLEURS Persian WER: 8.8% (vs 24.2% for NVIDIA’s previous Persian model)
- Conversational speech (YouTube, films): 26% vs 54% WER, roughly half the errors
- Runs on a laptop, about 10× faster than real time on an M1 Mac
- Works with NVIDIA NeMo and Hugging Face Transformers
The repo has the full training recipe, evaluation scripts and a local Gradio app for live mic transcription and offline audio file transcription.
Built on @NVIDIAAI’s Nemotron and NeMo.
Model: huggingface.co/mehdi-hf/nemo…
Code: github.com/mallahyari/nemotr…
3
7
367
Mehdi Allahyari retweeted
چون که چند نفری بهم پیام داده بودن که اگه میشه یه اپ اندرویدی هم درست بکنید، به خصوص برای کسایی که کمبینا یا نابینا هستن، تصمیم گرفتم که این اپلیکیشن رو درست بکنم.
نسخه اندروید آوا (tiny-ava) آماده شد: یه اپلیکیشن و موتور گفتار فارسی کاملاً آفلاین برای TalkBack که مخصوصاً برای کاربران نابینا و کمبینا طراحی شده.
همهچیز بدون اینترنت، بدون سرور و روی خود CPU گوشی اجرا میشه.
- اتصال مستقیم به TalkBack اندروید: کافیه توی تنظیمات گوشی «آوا» رو به عنوان موتور TTS انتخاب کنید تا کل گوشی، تلگرام، واتساپ، کروم و پیامها رو فارسی و بدون اینترنت بخونه
- کاملاً آفلاین و یکپارچه (حدود ۵۷ مگابایت): مدل صدای ۴.۵ میلیونی و G2P فارسی داخل خود APK هستن، هیچ دانلود اضافی نمیخواد و هیچ متنی از گوشی بیرون نمیره
- طراحی دسترسپذیر: دکمههای بزرگ، سه تم روشن، تیره و کنتراست بالا (زرد روی مشکی) مخصوص کمبینایان، و سرعت خواندن تا ۲.۵ برابر
- روخوانی با یک لمس: چسباندن از کلیپبورد و خواندن، اشتراکگذاری متن از هر اپ دیگه به «آوا» و ذخیره خروجی WAV
- واژهنامه تلفظ دلخواه: هر کلمه انگلیسی (مثل Wi-Fi و WhatsApp) یا کلمه همنویسه (مثل گُل / گِل) رو میتونید دائماً اصلاح کنید و قبل از ذخیره تستش کنید
تبدیل خودکار اعداد، ساعت، درصد و کلمات انگلیسی رایج
رایگان و متنباز (کد Apache-2.0 و وزن مدل CC BY 4.0).
دانلود مستقیم فایل APK (نسخه v1.0.0): github.com/mallahyari/tiny-a…
سورسکد و جزئیات کامل روی گیتهاب: github.com/mallahyari/tiny-a…
قطعا اپ نیاز به تغییرات زیادی داره و اگر دوست دارید، میتونید کد رو بردارید و تغییرات رو بهش بدید، یا PR درست و سابمیت بکنید.
اگر دوستی دارید که از TalkBack فارسی استفاده میکنه یا در حوزه دسترسپذیری کار میکنه، خیلی ممنون میشم این پست رو براش بفرستید. هر بازخورد یا پیشنهادی برای بهتر شدنش داشتید حتماً بگید.
Mehdi Allahyari retweeted
یه مدل تبدیل متن به گفتار فارسی (TTS) خیلی کوچیک ساختم به
اسم tiny-ava که میتونه مستقیم توی مرورگر یا روی موبایل و کاملاً آفلاین اجرا بشه.
چند تا نکته جالب درباره این مدل:
- از صفر (from scratch) و فقط با حدود ۲۰ ساعت دیتای صوتی سنتتیک (synthetic) آموزش داده شده
- فقط ۴.۵ میلیون پارامتر و حدود ۲۰ مگابایت حجم (با مدل G2P فارسیش جمعاً زیر ۳۰ مگابایت)
- سرعت روی CPU معمولی: ۳۸ تا ۷۷ برابر سریعتر از زمان واقعی (یه جمله ۵ ثانیهای تو کسری از ثانیه آماده میشه)
- خروجی ۲۴ کیلوهرتز، بدون نیاز به GPU، بدون سرور و بدون API
از اعراب و کسره اضافه هم پشتیبانی میکنه، یعنی اگه جای حساسی بود (مثلاً «گُل» و «گِل» یا کسره اضافه) میتونید خودتون تلفظ دقیقش رو کنترل کنید
دیگه برای ساختن اپهای صوتی فارسی لازم نیست هزینه سرور و GPU بدید. کلی کاربرد واقعی روی موبایل و دستگاههای سبک باز میشه:
اپهای کتابخوان و روخوانی مقاله به صورت کاملاً آفلاین روی اندروید و iOS
ابزارهای کمک به نابینایان و کمبینایان (Screen Reader) بدون تاخیر و بدون نیاز به اینترنت
مسیریابی صوتی، دستیارهای محلی و اپهای آموزشی
حفظ کامل حریم خصوصی کاربر، چون متن هیچوقت از گوشی بیرون نمیره
مدل با لایسنس CC BY 4.0 منتشر میشه (رایگان برای استفاده شخصی و تجاری، فقط با ذکر منبع).
مدل:
huggingface.co/mehdi-hf/tiny…
همین الان میتونید مستقیم توی مرورگر خودتون تستش کنید (بار اول حدود ۲۹ مگابایت دانلود میشه و بعدش آفلاین روی مرورگرتون میمونه): huggingface.co/spaces/mehdi-…
به ریپو گیتهاب حتما ستاره بدید، ممنون میشم.
Github: github.com/mallahyari/tiny-a…
کانال تلگرام: t.me/mlinfarsi
Mehdi Allahyari retweeted
سری جدید مدلهای تبدیل متن به گفتار فارسی (TTS) که آموزش دادم آماده شد. بهترین مدلهای TTS فارسی و اپن سورس.
- مدل Cilla-Lite که ۱۰۰ میلیون پارامتر و روی یک CPU معمولی کار میکند. و از اون جالبتر
- مدل Cilla-Mini که ۱۸ میلیون پارامتر و حدود ۱۰۷ مگابایت حجم. روی کامپیوتر موبایل و مرورگر اجرا میشود. به راحتی کار میکنه و فوق العاده سریع. نه سرور میخواهد، نه GPU، نه کلید API. کاملا لوکال. و با کیفیت عالی.
چقدر سریعه؟ روی یک هستهی M1 Pro حدود ۱۲ تا ۲۳ برابر سریعتر از زمان واقعی گفتار میسازد. داخل تب مرورگر حدود ۹ تا ۲۰ برابر. با حالت استریم، اولین صدا حدود ۲۰ میلیثانیه بعد از زدن دکمهی Speak پخش میشود.
کیفیتش چقدر خوب؟ روی ضبطهای واقعی، یک تشخیصدهندهی گفتار فارسی از خروجیاش ۱۰٫۴٪ خطای کلمه دارد. قابلیت clone کردن صدا. و شباهت به صدایی که به مدل میدهید: ۹۵%. مدل با صدای یک فایل صوتی کوتاه حرف میزند.
با استفاده از یک روش جدید مدل کوچک را درست کردم. اول یک مدل بزرگ فارسی ساختم، بعد قدمبهقدم کوچکش کردم (۳۲۶ میلیون، بعد ۱۰۰ میلیون، بعد ۱۸ میلیون).
ویدیوی پایین را حتما با صدا ببینید که کیفیت صدا را حس کنید. کامل توضیح میدم. برای انواع اپلیکیشن ها مثل خوندن صفحات وب یا کتاب. صدای ایجنت و کلی کار دیگه میتونید ازش استفاده کنید.
البته هنوز محدودیت هایی داره مثلا بعضی اضافهها (همان «ـِ» پیوند) را اشتباه میخواند و کلمههای انگلیسی داخل متن را رد میکند.
همین الان برید دانلود کنید توی مرورگر یا لوکال و امتحان کنید و فیدبک بدید.
لینکها:
cilla-mini: huggingface.co/mehdi-hf/cill…
cilla-lite: huggingface.co/mehdi-hf/cill…
Space: huggingface.co/spaces/mehdi-…
کانال تلگرام: t.me/mlinfarsi
Mehdi Allahyari retweeted
Run Ternary Bonsai 2 locally in Atomic Chat 🪴
@PrismML shrank Qwen3.5 7x so the 9B goes from 17.9 GB to just 2.42 GB and it keeps up or outperforms the original model on benchmarks
Run AI models locally -> atomic.chat
Today, we’re releasing Bonsai 2 2B, 4B, and 9B.
Based on Qwen3.5, these new ternary models bring stronger reasoning, visual understanding, and tool calling to compact footprints designed for everyday devices:
• 2B: 0.43GB
• 4B: 0.95GB
• 9B: 2.0GB
For this release, we focused on what makes small models useful as local assistants: following instructions, avoiding repetitive loops, calling tools on mobile devices, and giving useful answers without unnecessary output. The 9B model uses roughly 40% fewer tokens on standard instruction-following and everyday math tasks. Solving the Riemann hypothesis can wait.
These models are successors to our first-generation Bonsai 1.7B, 4B, and 8B, and provide a foundation for bringing practical agentic functionality to local applications on personal computers, phones, and wearables.
The Bonsai 2 family now includes four sizes spanning 2B to 27B parameters. Developers can choose the balance of capability, memory use, and responsiveness that fits their application and hardware.
Available today under Apache 2.0.
Mehdi Allahyari retweeted
We made open models run over 2x faster than Ollama, without any new hardware
Introducing Magnitude, an open source inference engine that runs open models as fast as your hardware allows. It tunes its kernels on your machine to find the fastest way to run each model
Works on Apple Silicon, NVIDIA, AMD, or just a CPU
On average across 11 popular local models:
Mac M4 Pro vs Ollama (MLX) 1.32x faster prefill, 2.19x faster decode
DGX Spark vs Ollama (llama.cpp) 1.34x faster prefill, 2.17x faster decode
Ollama, LM Studio, and llama.cpp ship one-size-fits-all kernels, because tuning each model for each chip by hand would take forever
Magnitude tunes them automatically. When you download a model, it spends up to a minute on your actual chip trying different ways to split up the math (how many GPU threads team up, how big a chunk each one takes, how far ahead to load data) and keeps the fastest combination that doesn't change the model's output
Each model also comes paired with the best speculative decoding drafter, for even more speed
One click connects Magnitude to the agent you already use (Pi, OpenCode, Hermes, Codex, and more). It's also built specifically for agents:
• Each agent uses about half the memory, thanks to a quantized KV cache
• Memory grows and shrinks with your sessions, so your computer stays usable
• Agents share prefix caches, so several can run at once without slowing down
Next, we're working on getting even more out of your hardware:
• Expert streaming from RAM or disk, to run models bigger than your GPU allows
• Splitting one model across all your GPUs and CPU so nothing sits idle
• Attention pruning that skips low-impact math, for much faster prefill
Ships as a desktop app on Mac, Windows, and Linux
100% free and open source
Download → magnitude.dev/download
GitHub → github.com/magnitudedev/magn…
Stop manually tuning machine learning hyperparameters.
Because human engineering time is finite, an MLE can explore less than 1% of the potential modeling space (features, loss functions, architectures, tuning knobs).
Instacart just solved this constraint by deploying autonomous AI agents directly into their internal ML modeling platform.
The result? The agent beat a mature production baseline by 4.8% on held-out error across 30 sequential experiments.
The win did not come from an LLM inventing a radical new neural net. It came from disciplined compounding across three stages:
1. Model Family Exploration: The agent migrated from an older histogram tree to LightGBM, capturing an immediate step-change.
2. Loss Function Calibration: It introduced a custom Huber loss threshold to dampen the distorting impact of extreme delivery outliers (snowstorms, traffic jams).
3. Compounding Marginal Wins: It tested small, unglamorous ideas humans rarely have time to test: recency sample weighting, seed averaging, and leaf capacity limits.
Individually, none of these adjustments was revolutionary. Together, they compound into millions in fulfillment efficiency.
The permanent shift: The MLE is no longer a manual model tuner. The MLE is a Research Director.
The human engineer defines the problem, freezes clean benchmark splits, and sets compute quotas. The agent explores the hypothesis tree around the clock.
I wrote a complete architectural breakdown with system diagrams, the 3 production failure modes, and a 35-line Python controller blueprint on MLnotes:
mlnotes.substack.com/p/the-a…
1
132
Stop trying to replace your CI/CD test suite with AI agents.
Every software team hates flaky end-to-end tests. A developer renames a CSS button, and your 30-step Playwright script derails on CI.
Naturally, teams are asking: why not hand the test to an AI agent that adapts dynamically?
Slack Engineering just ran over 200 automated agentic test runs to find out. Here is what the data revealed:
“Tests enforce journeys. Agents verify goals.”
Scripted tests validate the exact steps: click A, type B, assert C. Agents validate declarative intent: “log in and verify the thread reply appears,” adapting their clicks if a modal pops up.
In Slack’s benchmarks across real workspaces:
Agent + Playwright MCP achieved a 0% failure rate on simple flows and ~12% on complex discovery.
Agent + Playwright CLI failed twice as often (~20%) because shell commands drop session state.
AI-generated Playwright scripts failed 48% of the time on complex flows because static code recreates the same brittle selector traps.
So why not run agents on every pull request?
Because an agentic run costs $15 to $30 and takes 8 minutes. Putting agents on PR merge gates will explode your testing budget and paralyze engineering velocity.
Here is where agentic testing actually belongs: • Tier 1: Sub-second deterministic unit tests on every local save. • Tier 2: Deterministic Playwright scripts on core happy paths for PR gates. • Tier 3: Autonomous Agentic Explorers running nightly against staging environments to hunt down edge cases scripts never anticipated.
Let deterministic scripts enforce the journeys. Let autonomous agents verify the goals.
I wrote a complete architectural teardown with benchmark graphs and a Playwright MCP blueprint on MLnotes:mlnotes.substack.com/p/tests…
Stop pasting retrieved memories into your agent's system prompt.
Every developer building multi-turn AI agents eventually hits the Memory Paradox:
If you pass the full chat history, your context window explodes and latency spikes. If you truncate messages, your agent forgets critical user constraints. If you paste vector search results into your system prompt on every turn, you destroy your prompt prefix cache.
In a 25-turn conversation, a broken prompt cache means you pay 100% full, un-cached token prices on every single message.
Here is the architectural pattern that achieves permanent agent recall while keeping cache hit rates above 95%:
1.Asynchronous Extraction: Never extract memories synchronously on the user's critical path. Send chat payloads to an async background worker that extracts facts and reconciles state in place.
2.Negative Extraction Rules: Telling your model what to ignore ("do not record transient incidents, weather, or temporary mood states") does 10x more work than listing what to include. It prevents your database from hoarding irrelevant conversational junk.
3.The Dual-Tier Cache Split: Decouple your prompt into two distinct zones. Place static user profiles directly behind the system prompt (fetched once at session startup, 100% cached). Place dynamic search results at the very end of the prompt, after the user's latest query, as an un-cached tail.
In a 3,500-token prompt, roughly 3,400 tokens are served directly from cache at an 80% to 90% discount. You only pay full price for the ~100 tokens representing the new query and its specific memory block.
The takeaway: The most effective AI agents are not the ones that read the most tokens. They are the ones that know what to forget.
I wrote a complete architectural breakdown with diagrams and a Python starter blueprint on MLnotes:
mlnotes.substack.com/p/stop-…
Stop giving your AI agents 20,000-token system prompts.
When you stuff an agent’s prompt with runbooks and rules, it doesn’t get smarter. It suffers from “premature closure.” The moment it spots a deploy from 20 minutes ago, it blames that commit and sends your on-call engineers down a 45-minute wild goose chase.
Last week, Ramp showed how to fix this with their autonomous on-call agent (OCA).
Across 1,220 production incidents, the agent assisted with 575 merged fixes, cut human engineer triage time by 50%, and delivered interim diagnoses to Slack within 5 minutes.
Here is the architectural pattern that makes it work:
Ephemeral Sandboxes: The agent never touches production directly. It spins up in an isolated container with read-only API access to APM telemetry, git diffs, and database read-replicas.
Just-in-Time (JIT) Execution Hooks: Instead of front-loading instructions, the harness stays silent. The exact millisecond the agent tries to post to Slack, a hook detours execution and forces the agent to cross-verify its findings against the database and disprove its own theory.
The Human Sign-off Gate: The agent does the 20-minute log-hunting tax and opens a sandboxed draft PR. A human tech lead reviews the diff and does the 1-click merge.
The takeaway: The on-call engineer is no longer a manual log-sleuth. They are an executive code reviewer.
I wrote a complete architectural deep-dive with diagrams, the 3 hidden failure modes, and a minimal LangGraph starter blueprint on MLnotes:
👉 mlnotes.substack.com/p/the-a…
For the last three years, we've forced LLMs to act like conversational chatbots even when all our backend needed was a simple, structured decision. We begged models to output valid JSON, wrapped them in regex retries, and prayed they wouldn't hallucinate schema keys.
In my latest Substack article, I took a deep dive into Jev (by TypeSafe AI) and the broader paradigm of "System One" models—models designed specifically for software execution that return calibrated, type-safe decisions in under 100ms instead of generating text tokens.
I ran a benchmark on Apple Silicon comparing Jev, local Parallel Constrained Decoding (PCD), and traditional autoregressive JSON generation across 50 adversarial prompts.
Key takeaways from the benchmark and analysis:
• Evaluating structured decisions in parallel was 3.2x faster and slashed forward passes by 96.8% with 0% schema hallucination.
• Autoregressive models still suffer from instruction-content confusion (even at 98% schema adherence, that 2% failure rate breaks production pipelines).
• The future of AI software architecture is splitting into two clear tiers: deep, slow System 2 reasoning models (o3, Sonnet 3.7) for synthesis, and sub-100ms System 1 microservices for real-time routing, lossless agent context compaction, and guardrails.
Read the full breakdown, code snippets, and benchmark logs here:
mlnotes.substack.com/p/the-a…
Github code: github.com/mallahyari/system…
1
3
219
Mehdi Allahyari retweeted
🚀 Introducing the 𝙲𝚑𝚊𝚗𝚗𝚎𝚕𝚜 𝚂𝙳𝙺
Bring any Agent to any Channel.
Slack, MS Teams, WhatsApp, and more.
A significant jump from the state of the art across every dimension.
With support for:
→ Generative UI
→ Streaming replies
→ User-based auth
→ Per-user learning
Try it live: go.copilotkit.ai/TryChannels
GitHub: github.com/CopilotKit/channe…
Building commercial multi-agent pipelines often starts with a logical idea: copy human org structures.
A multi-agent chain where Agent A detects signals, Agent B locates sources, Agent C identifies root causes, and Agent D synthesizes recommendations.
In production, this architecture breaks down. Here is why and how to fix it:
1. Disconnected reasoning across handoffs
When reasoning is split across agents, context degrades. Agent C might identify a payer coverage issue, but Agent D recommends sending more sales reps.
Fix: Single reasoning owner.
Maintain one lead agent that owns end-to-end context and judgment. Spawn sub-agents dynamically for narrow execution tasks that return data, not decisions.
2. Using LLMs for deterministic tasks
Asking LLMs to scan raw data tables for statistical anomalies introduces noise and hallucinations.
Fix: Isolate deterministic pipelines.
Run statistical anomaly detection in standard code with fixed guardrails. Push confirmed signals onto a queue. The agent's job is to investigate signals, not detect them.
3. Unconstrained entity exploration
Allowing agents to dynamically query raw schemas without business logic leads to invalid join paths and irrelevant hypotheses.
Fix: Knowledge Graphs as control planes.
Treat Knowledge Graphs as bounded navigation spaces, not passive RAG databases. Every edge defines a valid business hypothesis for the agent to evaluate.
The result of restructuring: context drift drops to zero and complex multi-week diagnostic workflows run in minutes.
Youtube: youtube.com/watch?v=u6jJcIFD…
1
158
Most Text-to-SQL implementations fail when scaled to production.
Dumping database schemas into LLM context windows sounds great in demos, but breaks down quickly in the enterprise:
❌ LLMs write valid SQL that computes the wrong business metrics
❌ Queries join deprecated or renamed tables
❌ Ambiguous entity definitions lead to hallucinated numbers
In my latest article, I unpack why naive AI analytics fails and how to build a Governed Agentic Data Stack across 3 core layers:
1️⃣ Governed Semantic Layer: LLMs should query semantic layers (dbt, Cube, Looker), not raw database schemas.
2️⃣ Active Maintenance & CI: Data contracts and dynamic metadata syncing to prevent schema drift.
3️⃣ Modular Agent Skills: Multi-step agent loops for catalog search, metric API calls, and output validation.
Read the full breakdown here:
👉 mlnotes.substack.com/p/beyon…
1
1
203
Most RAG systems retrieve information before every single answer.
But should they?
For many questions, retrieval isn't necessary. For others, one search isn't enough. The model may need to search, evaluate the results, refine its query, and search again before it has enough evidence to answer.
That's the core idea behind Agentic RAG: treat retrieval as a decision, not a fixed pipeline.
In my latest article, I break down:
• Why traditional RAG often falls short on complex tasks
• How Agentic RAG enables iterative reasoning and retrieval
• The architecture behind retrieval-aware agents
• When Agentic RAG is worth the added complexity—and when a simple RAG pipeline is still the better choice
If you're building AI agents or RAG systems, understanding this shift is becoming increasingly important.
📖 Read the full article:
mlnotes.substack.com/p/agent…
1
90
A month ago I launched Overline, real-time AI captions & translation for any browser video.
Nearly 700 people signed up. 86% actually used it.
If you've tried it, please leave a review on the Chrome Store — it helps more than you'd think 🙏
After you rate and comment, let me know, I will add one hour to your plan.
chromewebstore.google.com/de…
2
82
Agentic RAG is the upgrade your retrieval pipeline actually needs.
I built a small, open-source harness for agentic RAG to show exactly why.
It's a harness on purpose: the agent loop, tools, and validation stay fixed while you swap the pieces around them, provider, model, prompts, retrieval, and A/B them on your actual workload. The only benchmark that matters.
Standard RAG retrieves once, blindly, before the model has thought about anything. Two-part question? It grabs context for half and makes up the rest. Exact term the embeddings don't get? Nothing. Docs don't cover it? It invents a citation that doesn't exist. These aren't bugs you can tune away, they're structural.
Agentic RAG changes the architecture: retrieval becomes a decision the model makes, not a step that happens to it.
The heart of agentic retrieval is a loop — reason, act, observe, repeat:
• Decides when to search
• Rewrites its own queries
• Searches again when the first attempt falls short
• Reads deeper only where context is thin
• Refuses to cite a source it didn't actually retrieve
And it's provably grounded: a post-hook checks every citation against what was truly retrieved. Invent one, the answer is rejected and sent back to revise. No silent hallucinated references. The harness wires it all up, hybrid search (vector + BM25), a cross-encoder reranker, the agent loop, citation validation, multi-provider via LiteLLM.
Full blog will be released soon.
Stop building one-shot RAG. Build agentic RAG instead.
github.com/mallahyari/rag-ag…
2
2
219













