Morocco is building an AI ecosystem from scratch. Not importing one. Building one.

The Maroc IA 2030 strategy targets $10 billion in GDP contribution, 50,000 AI jobs, and 200,000 trained graduates by the end of the decade. There's a planned 50MW sovereign cloud facility in Dakhla scaling to 500MW. Oracle is expanding its Casablanca R&D center from 300 to 1,000 engineers by 2027. Mistral AI signed an MoU to build a joint generative AI lab for sovereign language models. Five AI Jazari Institutes are being distributed across the country — Rabat, Nador, Guelmim-Oued Noun — deliberately placed in historically underserved regions, not just the usual Casablanca-Rabat axis.

On paper, the ambition is real. But having studied the ecosystem closely this week, I think the hardest problem isn't compute or funding. It's Darija.

Why Darija breaks everything

Every major LLM — GPT-4o, Gemini, Claude — was trained predominantly on English text. They handle Modern Standard Arabic (Fus7a) reasonably well because there's enough formal Arabic text on the internet. But Darija is a different animal entirely.

The problem is four things happening at once. Code-switching: Moroccans blend Arabic, French, Tamazight, and sometimes Spanish in a single sentence. "7bibi? كي داير 3la slamtk من lkhdm تار" — that's a real message. Good luck tokenizing it. Dual script: Darija is written in both Arabic script and Arabizi (Latin characters with numbers substituting Arabic sounds — 7 for ح, 3 for ع). There's no standardized orthography. The same word gets spelled five different ways depending on who's typing. High morphological variability: verb-to-noun transformations and complex affixes that confuse subword tokenizers trained on Fus7a. And resource scarcity: there's a historic lack of annotated corpora, sentiment lexicons, and standardized grammar rules.

The TerjamaBench results made this concrete. They benchmarked English-to-Darija translation across proprietary and open-source models. Gemini scored 84% on human evaluation. But look at what the models actually produce: literal translations, awkward Fus7a fallbacks, unnatural phrasing. GPT-4o injects Fus7a vocabulary like مضحك where a Darija speaker would never use it. Claude uses an unnatural definite article where Darija just says بنادم. The automated metrics (BLEU, chrF) show weak correlation with human judgment because the metrics themselves can't capture dialectal adequacy or cultural idioms.

In other words, the models score well on tests that don't measure what actually matters.

What Morocco has built so far

The grassroots community is further ahead than you'd think. AtlasIA built Atlas-Chat, the first LLM collection developed specifically for Moroccan Darija — 2B and 9B parameter models that outperform other Arabic-specialized LLMs in human evaluations. They also built Terjman for English-to-Darija translation and DODa V2, the largest collaborative open-source Darija-English dataset with over 45,000 translated sentences and 56,000 translated words across dual-script formats.

At SemEval-2025, AtlasIA demonstrated emotion detection in Darija using lightweight FastText architectures — subword-aware preprocessing to handle the morphological chaos, achieving 46% accuracy across a 7-label emotion classification task. Not spectacular numbers, but it's a baseline where none existed before.

MoroccoAI runs annual conferences bridging academia and industry, from Vision Transformers to feature selection. InnovAI hackathons push rapid prototyping with 30,000 MAD prize pools, using NLLB-200 and Atlas-Chat models to solve challenges in healthcare, agriculture, education, and legal AI.

The community is small but active. Over 100 starred GitHub repositories for Darija NLP resources. TerjamaBench and DarijaMMBU as benchmarks. A real pipeline forming.

The sovereignty question

The thing I keep thinking about from this notebook is sovereignty. Africa was the first continent to leapfrog into mobile payments — M-Pesa in Kenya bypassed the entire banking infrastructure that Western countries spent decades building. The argument is that Morocco could do something similar with AI: skip the phase where you're a consumer of American and European AI, and build sovereign models and infrastructure tailored to local linguistic and cultural realities.

But sovereignty requires more than a government strategy document. It requires infrastructure that actually works for the languages people speak. Right now, if a Moroccan citizen interacts with an AI system in Darija, the system will fail in ways that a French or English speaker never experiences. That's not a theoretical problem. It's a practical exclusion.

The Jazari Institutes are supposed to be the backbone — distributed centers of excellence for training, applied research, and incubation. But the institutes need software to run on their hardware. They need serving infrastructure optimized for the GPUs they'll actually have. They need agent systems that can handle multilingual citizen interactions. They need evaluation frameworks that measure whether the output is culturally appropriate, not just grammatically correct.

That's the gap. Morocco is building the physical infrastructure (data centers, institutes, R&D centers) and the data layer (DODa, Atlaset, TerjamaBench). What's missing is the systems layer in between: the serving optimization, the multi-agent coordination, and the multilingual evaluation methodology.

Where my thesis fits

I started this notebook series studying inference optimization, moved to multi-agent coordination, then to AI engineering methodology. This final notebook closes the loop. The question isn't abstract anymore.

RQ1 (efficient serving) maps to: how do you run LLM inference on the hardware the Jazari Institutes will actually have? Not A100 clusters. Probably T4s, maybe A10s, mixed with whatever Oracle and partners provide.

RQ2 (multi-agent coordination) maps to: how do you orchestrate multiple specialized agents — one for Arabic administrative text, one for Darija citizen queries, one for French legal documents — on that constrained infrastructure?

RQ3 (multilingual evaluation) maps to: how do you know the system actually works? BLEU scores won't tell you. LLM-as-a-judge won't tell you (it has the same Darija blind spots). You need evaluation methodology built specifically for code-switching, Arabizi, and dialectal adequacy.

Everything I've studied across the five notebooks converges here. The infrastructure layer (PagedAttention, quantization, speculative decoding) makes it possible to run on limited hardware. The coordination layer (AutoGen, conversation protocols, memory systems) makes it possible to compose multiple agents. The engineering discipline (specifications, evaluation, debugging) makes it possible to verify the system works. And Morocco provides the test case where all three problems exist simultaneously and none of them have been solved.

Papers & Resources

  • Maroc IA 2030 — National AI Strategy — Ministère de la Transition Numérique
  • AtlasIA — Atlas-Chat, DODa V2, Terjman, TerjamaBench — github.com/AtlasIA
  • MoroccoAI — Annual Conferences (2021-2025) — morocco.ai
  • Oracle Morocco R&D Center — Casablanca expansion announcement
  • Mistral AI — Morocco MoU for sovereign generative AI lab
  • InnovAI Hackathon framework — NLLB-200, Atlas-Chat applications

I'm Mustapha Liaichi, an AI engineer exploring the frontier of LLM systems and autonomous agents. These notes document my research journey. Reach me at mustaphaliaichi@gmail.com