<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mohsen</title>
    <description>The latest articles on DEV Community by Mohsen (@mohsenz72).</description>
    <link>https://dev.to/mohsenz72</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F827658%2F957f4b76-2aba-4374-87f0-5df843a5652b.jpeg</url>
      <title>DEV Community: Mohsen</title>
      <link>https://dev.to/mohsenz72</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mohsenz72"/>
    <language>en</language>
    <item>
      <title>I run a production AI app for €60 a month. Here is the actual bill.</title>
      <dc:creator>Mohsen</dc:creator>
      <pubDate>Tue, 22 Sep 2026 16:50:52 +0000</pubDate>
      <link>https://dev.to/mohsenz72/i-run-a-production-ai-app-for-eu60-a-month-here-is-the-actual-bill-2iop</link>
      <guid>https://dev.to/mohsenz72/i-run-a-production-ai-app-for-eu60-a-month-here-is-the-actual-bill-2iop</guid>
      <description>&lt;p&gt;Every time someone posts an AI side project, the same comment appears: &lt;em&gt;nice, but what does it cost to run?&lt;/em&gt; Almost nobody answers with numbers. So here are ours.&lt;/p&gt;

&lt;p&gt;TailStory is a pet health record. A photo becomes a structured profile. A spoken sentence becomes several log entries. An assistant answers questions about &lt;strong&gt;that specific animal&lt;/strong&gt;, grounded in its own history plus a veterinary book corpus, and cites what it read. There is a recommendation engine and a nine-area photo health check. It ships on iOS in 21 languages, and it is built by two people.&lt;/p&gt;

&lt;p&gt;The whole thing runs on &lt;strong&gt;one VPS&lt;/strong&gt;, and the bill is €60–200 a month depending on traffic. Here is where the money actually goes.&lt;/p&gt;

&lt;h2&gt;
  
  
  The bill, per operation
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Operation&lt;/th&gt;
&lt;th&gt;Cost&lt;/th&gt;
&lt;th&gt;What happens&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Photo → structured profile&lt;/td&gt;
&lt;td&gt;~€0.001&lt;/td&gt;
&lt;td&gt;One multimodal call. Species, breed, coat, build, body condition, visible observations — each with a confidence score&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Voice log&lt;/td&gt;
&lt;td&gt;~€0.002&lt;/td&gt;
&lt;td&gt;One call that transcribes &lt;strong&gt;and&lt;/strong&gt; structures. Not two calls&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Assistant message&lt;/td&gt;
&lt;td&gt;~€0.002–0.006&lt;/td&gt;
&lt;td&gt;A tool loop, up to five model calls when it needs the record and the corpus&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Recommendations&lt;/td&gt;
&lt;td&gt;~€0.003 / pet / week&lt;/td&gt;
&lt;td&gt;Rule prefilter → vector rank → one model pass, cached for seven days&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Push notifications&lt;/td&gt;
&lt;td&gt;€0&lt;/td&gt;
&lt;td&gt;Expo&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Storage + database&lt;/td&gt;
&lt;td&gt;~€0.02 / active user / month&lt;/td&gt;
&lt;td&gt;Postgres and an images bucket&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Everything else&lt;/td&gt;
&lt;td&gt;€60–200 / month&lt;/td&gt;
&lt;td&gt;One VPS, pm2, nginx, Cloudflare in front&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;The number that surprised us&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A very heavy user — thirty assistant messages a day plus a daily health check — costs &lt;strong&gt;a few cents a month&lt;/strong&gt; in inference. Their storage and database footprint costs more than their AI does. We spent months worrying about the wrong line item.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Inference is not the expensive part
&lt;/h2&gt;

&lt;p&gt;This is the thing I wish someone had told me before I started. At current flash-tier pricing, a multimodal call on a photo costs about a tenth of a cent. You can build a product where &lt;strong&gt;every single interaction is an AI call&lt;/strong&gt; and still run at software margins. Our subscription nets €5.09 after the store fee, which puts gross margin above 95%.&lt;/p&gt;

&lt;p&gt;What does cost money, in rough order: storage you forgot to prune, a database you did not index, egress, and a server sitting idle because you reached for managed everything. None of that is AI. It is the same boring infrastructure discipline that mattered before any of this.&lt;/p&gt;

&lt;h2&gt;
  
  
  Four decisions that kept it cheap
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. One call doing two jobs
&lt;/h3&gt;

&lt;p&gt;The obvious way to build voice logging is speech-to-text, then a second model call to turn the text into structured entries. We send the audio once to a multimodal model and ask for structured output directly. Half the calls, half the latency, and no transcription errors compounding into the extraction step.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Cheap code before expensive tokens
&lt;/h3&gt;

&lt;p&gt;The recommendation pipeline is a rule prefilter, then a vector rank, then exactly one model pass over what survives. Every stage exists to shrink what the next stage sees. Sorting a candidate set in Postgres costs nothing; sorting it with a language model costs money every single time.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Cache anything that is not about right now
&lt;/h3&gt;

&lt;p&gt;Recommendations are cached for seven days. A dog's dietary needs do not change between Tuesday and Wednesday, and regenerating them daily would have multiplied that line by seven for no user-visible benefit. Decide the natural refresh interval of each feature, then be honest that it is longer than your instinct says.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Per-user daily counters, not global rate limits
&lt;/h3&gt;

&lt;p&gt;The real cost risk in an AI product is not scale. It is one scripted client in a loop. A global rate limit protects your server and does nothing about your bill, because the abusive traffic looks like success. A per-user daily counter caps the blast radius to one account, and it doubles as the mechanism for a free tier.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;On the boring stack&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;NestJS, Postgres, one VPS with pm2 and nginx, Cloudflare in front, an Expo app and a Next.js site. No Kubernetes, no queue we did not need, nothing serverless. At this size the boring stack is not a compromise — it is the reason the bill fits in a sentence.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  What we got wrong
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;We optimised token counts before measuring.&lt;/strong&gt; Weeks of prompt-trimming saved less than one unindexed query was costing. Measure the bill before you optimise the part that feels expensive.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;We stored original images too long.&lt;/strong&gt; Re-encoding to WebP at upload and pruning aggressively saved more than any model change we made.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;We assumed the assistant would be the cost centre.&lt;/strong&gt; It is roughly the cheapest feature per user we ship.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The part that is not about money
&lt;/h2&gt;

&lt;p&gt;Cheap inference is why this product exists at all. Every pet app before this one asked the owner to type, and by week two owners stop typing. Being able to infer the record from a photo, a sentence or a single tap — for a tenth of a cent — is what makes a health record that fills itself in economically possible for a consumer subscription.&lt;/p&gt;

&lt;p&gt;One design rule came out of that, and it is the one I would defend hardest: &lt;strong&gt;every inferred field carries a confidence score, and nothing is written until the owner confirms it.&lt;/strong&gt; Breed reads high. Body condition reads medium. Age from a photo reads low, because age from a photo genuinely is hard. A guess the user has never seen is not a medical record, and a system that marks everything "high" is lying to someone who may act on it.&lt;/p&gt;

&lt;p&gt;If you want to see what the numbers above actually buy, &lt;a href="https://apps.apple.com/app/id6800637023" rel="noopener noreferrer"&gt;TailStory is on the App Store&lt;/a&gt; — point it at your own animal and watch the form fill itself in. If you just came for the bill, take the table and go build something.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Which model are these costs based on?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A flash-tier multimodal model at published pay-as-you-go pricing, as of September 2026. The figures are averages from our own usage, not vendor estimates. Model pricing moves; the shape of the argument — that inference is cheaper than the infrastructure around it — has held through every change so far.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does €60 a month include everything?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It covers the VPS, the database and storage at current volume. Inference is on top and, at our usage, adds cents rather than euros per active user. It excludes the Apple Developer Program fee and domain costs, which are fixed annual line items rather than running costs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Would this hold at a million users?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;No, and we would not claim it. At that scale storage, egress and database load grow faster than the AI bill and the architecture changes. This post is about what a small production app actually costs, which is the number nobody publishes and every indie developer wants.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why one VPS instead of serverless?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Predictable cost and no cold starts on a request path that already waits on a model. Serverless is excellent when load is spiky and you cannot predict it. Ours is steady and small, so a single machine we understand beats a bill we cannot forecast.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>startup</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
