The cost of an enterprise AI project is the full set of spending required to design, deploy, and then operate an artificial-intelligence solution over several years: data preparation, models and APIs, integration, maintenance, governance, and compliance. ROI measures, against that, the value the solution creates (savings, revenue, risks avoided) once weighed against total cost.
Bottom line: in Morocco, the success gap on an AI project almost never turns on the technology. It turns on two badly instrumented things: a total cost of ownership that is underestimated (the "run" and compliance, not just the "build"), and value that is never measured against a starting baseline. Measure before you launch, model the local frictions (Office des Changes, withholding tax, CNDP), and start small.
Most executives ask the question backwards. They ask "how much does an AI project cost?" before they ask "what specific value will it create, and how will I measure it?" The market data is unambiguous here. MIT's Project NANDA report, "The GenAI Divide: State of AI in Business 2025," estimates that roughly 95% of organizations are getting zero return from their generative-AI pilots, and that only about 5% extract significant value. The report attributes the gap not to infrastructure, regulation, or talent, but to a "learning gap": systems that do not retain feedback and do not improve. In other words, the problem is rarely the model. It is the use case, poorly framed and never instrumented.
This article offers a decision framework for answering both questions together: the real cost and the real value. It is written for decision-makers at medium-to-large Moroccan firms who want to budget an AI project without being ambushed by invisible cost lines, and without promising an ROI they cannot demonstrate.
Why do so many AI projects stall at the pilot stage?
"POC purgatory" is the most expensive trap on the market. You launch an impressive proof of concept in a demo, and it never reaches production because nobody defined, up front, what it was supposed to improve or how that improvement would be measured. Gartner predicted that at least 30% of generative-AI projects would be abandoned after proof of concept by the end of 2025, citing poor data quality, inadequate risk controls, escalating costs, or unclear business value.
McKinsey's "The State of AI in 2025" confirms the mechanics: roughly 88% of organizations use AI in at least one function, yet a majority report no meaningful impact on enterprise-wide EBIT, and about two-thirds of AI users remain stuck in experiment or pilot mode, with only around a third reporting genuine scaling. The lesson for a Moroccan executive is blunt: the question is not "does it work in the demo?" but "do I have a quantified baseline before the pilot, and a KPI that will prove the impact after?" Without that, you are funding an experiment, not an investment. Our complete AI guide for Moroccan businesses details how to frame a first profitable use case.
What are the real cost lines of an AI project?
The visible cost (development) is only the tip. Most of the cost sits below the waterline: operations and compliance, which you pay every year, not once. Think in terms of total cost of ownership over two to three years, split into three blocks.
| Cost block | What it covers | Nature | |---|---|---| | Build (design) | Data preparation and cleaning, model selection, API/token costs in development, build-vs-buy, integration with existing systems (ERP such as SAP, Odoo, Microsoft Dynamics, Sage; legacy and on-prem systems) | One-off, but recurs with each iteration | | Run (operations) | MLOps and maintenance, monitoring, retraining, model-drift management, inference/token cost at scale, ongoing change management | Recurring, often underestimated | | Governance and compliance | CNDP conformity (Law 09-08), data-residency decisions, security (Law 05-20), audit and documentation, human oversight of automated decisions | Recurring, not optional |
Two points deserve particular vigilance. First, the cost of data: Gartner estimates that poor data quality costs organizations roughly $12.9 million per year on average, which makes data readiness a major hidden line. The popular claim that "80% of a data scientist's time is spent cleaning data" is contested (independent surveys put data preparation closer to about 45% of time); keep the direction, not the exact figure. Second, inference cost: it is rising faster than per-token prices fall, driven by volume and agentic architectures. Gartner notes that an agentic workflow can consume 5 to 30 times more tokens per task than a standard chatbot, which makes spend genuinely hard to forecast.
How do you measure AI ROI without inventing numbers?
The ROI of an AI project rests on four value levers, and each must be tied to a measurable KPI before launch. Cost reduction (efficiency: hours saved, tickets handled automatically); revenue and growth (conversion rate, average basket, qualified leads); risk reduction (errors avoided, fraud detected, compliance); and speed, or time-to-value (processing time, time-to-market).
The method matters more than the formula. Establish a baseline before the pilot: how much time, error, or cost does the process generate today? Then build a simple TCO model over two to three years (build + run + governance). Compare realized value against projected value, honestly, including qualitatively when no reliable figure yet exists. A project that "clearly saves several FTEs of data entry," documented, beats a fabricated "X% ROI." To structure this value logic across the organization, lean on our AI transformation service, which starts from the business case and its measurement, not from the tool.
The Moroccan layer: why the real cost of foreign APIs is higher than the sticker price
This is the blind spot of generic comparisons. The dirham is not freely convertible: every currency flow between Morocco and abroad is governed by the Office des Changes' Instruction Generale des Operations de Change (IGOC), a new version of which, IGOC 2026, took effect on 1 January 2026. Paying OpenAI, Anthropic, AWS, Azure, or a SaaS subscription is not forbidden, but it is channelled through two main routes: the company e-commerce dotation (an international payment card, which covers software, SaaS subscriptions, and digital services) or the import-of-services regime (written contracts and invoices, with no fixed ceiling).
Above all, model the tax. Gross sums paid to non-resident service providers are subject to a 10% withholding tax (Article 15 of the CGI), unless reduced by a tax treaty. That withholding mechanically raises the true cost of your foreign APIs and SaaS: build it into the TCO, do not ignore it. Worth knowing for younger firms: startups labelled by the ADD can finance cloud and SaaS through a raised annual e-commerce dotation (reported at 2 million MAD, double the IGOC 2024 level). Check eligibility before assuming a currency constraint.
Is data governance a cost line or a risk to ignore?
It is a defensible cost line, and deferring it amounts to provisioning a risk. Morocco has no AI-specific law. The framework rests on Law 09-08 (personal data protection) and Law 05-20 (cybersecurity), both drafted before the AI boom and not designed for automated decision-making; the Ministry of Justice has begun reflections on a future AI law, but none is in force. The practical consequence: using customer or HR data to train or feed a model hosted abroad falls under articles 43 and 44 of Law 09-08. A transfer outside Morocco is only allowed if the destination country ensures a sufficient level of protection; otherwise, prior CNDP authorization (or, in some cases, explicit informed consent) is required. There is no automatic adequacy mechanism comparable to the EU GDPR.
A caveat: there is no general obligation to store data on Moroccan soil. The constraint bears on cross-border-transfer conditions, not on imposed residency. Penalties remain modest but real: 10,000 to 100,000 MAD for a data file implemented without declaration or authorization (art. 52); 3 months to 1 year of imprisonment and/or 20,000 to 200,000 MAD for an unlawful transfer to a foreign state (art. 60). And the context has shifted: in 2025 the CNDP moved from awareness-raising to active enforcement, with targeted sectoral campaigns and set deadlines. Our enterprise AI governance guide details the control matrix to put in place.
Build or buy: which decision for a Moroccan enterprise?
The build-vs-buy choice is settled less on sticker price than on total cost and risk. Skilled ML/MLOps talent in Morocco is, comparatively, affordable against Europe or the US, but genuinely scarce. That scarcity pushes the calculus, for many SMEs and mid-caps, toward managed solutions or a partner: an in-house "build" path implies hiring, upskilling, and retention, and those risks inflate the real cost well beyond salaries.
| Criterion | Leans "build" in-house | Leans "buy" / managed partner | |---|---|---| | Use case | Core business, differentiating | Standard, cross-functional (support, HR, finance) | | Data | Highly sensitive, strong CNDP constraints | Anonymizable or non-personal | | Available talent | ML/MLOps team already in place | No dedicated data team | | Horizon | Long term, high volume | Fast time-to-value sought | | "Run" cost | Controlled in-house | Outsourced, predictable |
Whichever path you take, two traps lurk: vendor lock-in, which makes any migration costly, and "shadow AI," those subscriptions taken out by teams off the finance team's radar, which escape both the TCO and compliance. Map that spend before it becomes a risk.
FAQ
What does an AI project cost on average in Morocco? There is no credible "an AI project costs X MAD" benchmark: the spread is too wide depending on the use case, the data, and the architecture. Reason instead in total cost of ownership over two to three years, split across build, run, and governance. A standard managed use case costs far less than a custom in-house build, especially once the "run" is included.
What ROI can I expect from an AI project? No reliable average ROI figure or payback period exists for Morocco. The MIT NANDA report even estimates that roughly 95% of generative-AI pilots return nothing, for lack of an instrumented use case. ROI depends on your ability to measure a baseline before launch and to track a precise KPI afterward. No measurement, no demonstrable ROI.
Does the 10% withholding tax apply to my foreign AI subscriptions? Yes, in principle. Gross sums paid to non-resident providers are subject to a 10% withholding tax under Article 15 of the CGI, unless reduced by a tax treaty. This raises the true cost of your foreign APIs and SaaS. Build this line into your TCO and check the treaty applicable to the provider's country.
Can I train an AI model with my Moroccan customers' data? Not freely if the model is hosted abroad. Articles 43 and 44 of Law 09-08 govern cross-border transfer: you need a sufficient level of protection in the destination country, CNDP authorization, or explicit consent. There is no automatic adequacy. Anonymization, or local or EU hosting, can lift the constraint, but adds cost and time.
Does Morocco have an AI-specific law to anticipate? No, no AI law is in force. The framework rests on Law 09-08 (personal data) and Law 05-20 (cybersecurity). The Ministry of Justice has begun reflections on a future law, but nothing is enacted. Anticipate by imposing human oversight of automated decisions on yourself now: it is a defensible cost line, not an expense to postpone.
Sources
Last verified: 17 June 2026.
- MIT Project NANDA, "The GenAI Divide: State of AI in Business 2025" (Aditya Challapally), July-August 2025.
- Gartner, press release of 29 July 2024 (Rita Sallam, Gartner Data & Analytics Summit) on the abandonment of generative-AI projects after POC.
- McKinsey, "The State of AI in 2025" Global Survey, November 2025.
- Law 09-08 on personal data protection, articles 43, 44, 52, and 60; CNDP communiques (coverage via Upsilon Consulting, korte-law.com).
- Law 05-20 on cybersecurity.
- Office des Changes, Instruction Generale des Operations de Change (IGOC 2026), oc.gov.ma; Upsilon Consulting, "Dotations Office des Changes Maroc 2026."
- Moroccan General Tax Code (CGI), article 15 (withholding tax on non-residents).
- Gartner (poor-data-quality cost estimate; 2026 analysis of agentic inference costs, via TechAhead); Deloitte, Q4 2025 commentary on inference costs.
- Anaconda, State of Data Science survey (share of time spent on data preparation).
- Finances News Hebdo and Infomediaire, Office des Changes measures for ADD-labelled startups (2024-2025).
- Policy Center for the New South, Village de la Justice (Zakia Yaqouti, Zakaria Garno), Lafrouji Avocats: 2025-2026 analyses of Morocco's AI legal framework.
The takeaway: an AI project succeeds when its total cost is modelled honestly and its value is measured from day one; to frame your TCO and ROI on a first use case, let's talk.
