<?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: Basavaraj Patil</title>
    <description>The latest articles on DEV Community by Basavaraj Patil (@basavarajpatil660).</description>
    <link>https://dev.to/basavarajpatil660</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%2F4021933%2F4a5a86fe-769f-471c-8805-7808448dd765.png</url>
      <title>DEV Community: Basavaraj Patil</title>
      <link>https://dev.to/basavarajpatil660</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/basavarajpatil660"/>
    <language>en</language>
    <item>
      <title>Three bugs that each cost me a full day building a self-hosted AI gateway on Supabase</title>
      <dc:creator>Basavaraj Patil</dc:creator>
      <pubDate>Mon, 24 Aug 2026 16:34:23 +0000</pubDate>
      <link>https://dev.to/basavarajpatil660/three-bugs-that-each-cost-me-a-full-day-building-a-self-hosted-ai-gateway-on-supabase-cil</link>
      <guid>https://dev.to/basavarajpatil660/three-bugs-that-each-cost-me-a-full-day-building-a-self-hosted-ai-gateway-on-supabase-cil</guid>
      <description>&lt;p&gt;I've been building an open-source project called Keyroute, a self-hosted AI API gateway that lets you use one API key to route requests to multiple providers (OpenAI, Gemini, Groq, etc) instead of juggling separate keys and separate integration code for each one.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fo3dv85c0enq1y2kjvv3p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fo3dv85c0enq1y2kjvv3p.png" alt=" " width="800" height="438"&gt;&lt;/a&gt;&lt;br&gt;
The whole point of it is that it runs entirely inside YOUR own Supabase project, not on any server of mine. No relay, no third party sitting between you and your AI provider. Setup is one button, no CLI needed.&lt;/p&gt;

&lt;p&gt;Getting there wasn't smooth. Here are three bugs that each ate a full day, in case any of these save someone else the same pain.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bug 1: "Invalid multipart boundary"
&lt;/h2&gt;

&lt;p&gt;The Deploy Gateway button needs to actually deploy a Supabase Edge Function programmatically, through Supabase's Management API, from the browser.&lt;/p&gt;

&lt;p&gt;My first attempt sent JSON, since that's what basically every other API expects these days. Kept getting rejected with an "Invalid multipart boundary" error that told me nothing useful.&lt;/p&gt;

&lt;p&gt;Turns out the function-deploy endpoint needs real multipart/form-data: the slug goes as a query param, there's a metadata part as a JSON string, and then one separate file part per source file. Not obvious at all from the error message, took a lot of trial and error against a real project to get the exact shape right.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bug 2: the email domain nobody warns you about
&lt;/h2&gt;

&lt;p&gt;Since Keyroute has no login/signup flow (there's a single auto-provisioned owner account created during setup), I needed to generate a synthetic email for that account behind the scenes.&lt;/p&gt;

&lt;p&gt;First attempt: &lt;code&gt;owner@local.keyroute&lt;/code&gt;. Rejected by Supabase Auth as invalid.&lt;/p&gt;

&lt;p&gt;Second attempt: I switched to my own real domain, &lt;code&gt;@local.basavaraj.dev&lt;/code&gt;. This worked, but it bugged me, since it meant every single person who self-hosts this project would have my personal domain baked into their database. Not a good look for an open source project other people are supposed to run themselves.&lt;/p&gt;

&lt;p&gt;Ended up landing on &lt;code&gt;@example.com&lt;/code&gt;, which is an actual RFC 2606 reserved placeholder domain, made exactly for situations like this. Verified it against real Supabase Auth and it worked cleanly. Small fix, but the kind of thing that's easy to get wrong in a way that quietly ships something awkward.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bug 3: RLS was right, but reads still failed
&lt;/h2&gt;

&lt;p&gt;This one really got me. I had Row Level Security policies set up correctly on four tables. Tested with a real, valid, logged-in session. Reads still failed.&lt;/p&gt;

&lt;p&gt;Spent a long time assuming this was a session or auth token issue, since that's usually what "valid session but no data" means.&lt;/p&gt;

&lt;p&gt;It wasn't. In Postgres, RLS policies and table-level GRANTs are two completely separate permission systems. You can have perfect RLS policies and still block every request if the &lt;code&gt;authenticated&lt;/code&gt; role was never explicitly granted access to the table itself. I'd done the policies and just... never done the grants.&lt;/p&gt;

&lt;p&gt;Once I ran the GRANT statements, everything worked instantly. Felt a little silly after how long I spent debugging it as an auth problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bonus lesson: don't trust "commit succeeded" from an AI coding tool
&lt;/h2&gt;

&lt;p&gt;Not a code bug, but worth mentioning since it almost caused a real problem. I'm using an AI coding assistant to help implement changes, and at one point it reported "committed and pushed successfully" when in reality only &lt;code&gt;git add&lt;/code&gt; had run, no commit ever happened.&lt;/p&gt;

&lt;p&gt;I only caught it because I checked GitHub directly and saw nothing new there. Now I always verify against raw &lt;code&gt;git log&lt;/code&gt; / &lt;code&gt;git status&lt;/code&gt; output myself instead of trusting a prose summary, especially for anything commit or push related.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where it's at now
&lt;/h2&gt;

&lt;p&gt;Keyroute is open source, MIT licensed, and self-hostable. Still has some gaps (no Anthropic routing yet, no rate limiting yet, single-owner model for now), but the core flow works end to end.&lt;/p&gt;

&lt;p&gt;Repo: github.com/basavarajpatil660/the-keyroute-project&lt;/p&gt;

&lt;p&gt;If you've hit similar Supabase Edge Function or RLS quirks, or have thoughts on the architecture, I'd genuinely like to hear about it.&lt;/p&gt;

</description>
      <category>supabase</category>
      <category>opensource</category>
      <category>webdev</category>
      <category>showdev</category>
    </item>
    <item>
      <title>I built a Telegram-native AI agent on free-tier infra — here's the stack and what broke</title>
      <dc:creator>Basavaraj Patil</dc:creator>
      <pubDate>Thu, 09 Jul 2026 20:30:00 +0000</pubDate>
      <link>https://dev.to/basavarajpatil660/i-built-a-telegram-native-ai-agent-on-free-tier-infra-heres-the-stack-and-what-broke-11bd</link>
      <guid>https://dev.to/basavarajpatil660/i-built-a-telegram-native-ai-agent-on-free-tier-infra-heres-the-stack-and-what-broke-11bd</guid>
      <description>&lt;p&gt;I'm Basavaraj Patil (Basavaraj_nick), a self-taught dev and CS diploma student, and I built a Telegram-native multi-agent AI system entirely on free-tier infrastructure — no server bills, no paid APIs. Here's how it works, and what broke along the way.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it does
&lt;/h2&gt;

&lt;p&gt;It's not a chatbot. It's a full agent system that lives inside Telegram — 14+ commands, 8 autonomous sub-agents running on schedules, image generation, web research, and memory that persists across conversations. All of it running on free tiers.&lt;/p&gt;

&lt;h2&gt;
  
  
  The stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cloudflare Workers&lt;/strong&gt; — two workers (github-backend + image-api) handle routing and image requests&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub Actions&lt;/strong&gt; — 8 sub-agents run on cron schedules throughout the day (IST)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Telegram Bot API&lt;/strong&gt; — the entire interface; no web dashboard needed&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cloudflare D1&lt;/strong&gt; — logs commands and stats to a dashboard&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cloudflare KV&lt;/strong&gt; — a 5-minute rolling memory window so the agent has short-term conversational context&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;LLM chain&lt;/strong&gt;: Mistral → Cerebras → Groq → OpenRouter → Gemini, falling back in that order so a single provider's rate limit never takes the whole thing down&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Image gen&lt;/strong&gt;: FLUX 1 Schnell as primary, Pollinations AI as fallback&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Image editing&lt;/strong&gt;: Stable Diffusion v1.5 img2img for the &lt;code&gt;/edit&lt;/code&gt; command&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Web research&lt;/strong&gt;: Tavily + Jina for live search grounding&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why Telegram, not a web app
&lt;/h2&gt;

&lt;p&gt;Every other agent framework I looked at assumed you'd build a dashboard. I didn't want to maintain a frontend, an auth flow, and a backend just to send myself a daily briefing. Telegram already solved auth, mobile notifications, and UI. The bot &lt;em&gt;is&lt;/em&gt; the UI.&lt;/p&gt;

&lt;h2&gt;
  
  
  What actually broke
&lt;/h2&gt;

&lt;p&gt;A few patterns that cost real debugging time, in case they save you some:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Return-type mismatches across agents&lt;/strong&gt; — when 8 sub-agents pass data between each other, one agent returning a slightly different shape than the next one expects fails silently until something downstream breaks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub Actions permissions on workflow files&lt;/strong&gt; — Actions can't modify other workflow files by default; needed explicit permissions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;KV memory misconfiguration&lt;/strong&gt; — early versions stored memory in a public repo &lt;code&gt;memory.json&lt;/code&gt;, which is a bad idea for anything with even mildly sensitive context. Moved it to private Cloudflare KV.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;RLS conflicts&lt;/strong&gt; — wherever a database enforces row-level security, make sure your service role key is actually bypassing it where intended, or reads silently return empty sets.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Where it stands now
&lt;/h2&gt;

&lt;p&gt;The repo is public and secrets-clean — full README with the architecture, a competitor comparison, and the env var table if you want to run your own version.&lt;/p&gt;

&lt;p&gt;Repo: &lt;a href="https://github.com/basavarajpatil660/Ultimate-Ai" rel="noopener noreferrer"&gt;github.com/basavarajpatil660/Ultimate-Ai&lt;/a&gt;&lt;br&gt;
More of what I'm building: &lt;a href="https://basavaraj.dev" rel="noopener noreferrer"&gt;basavaraj.dev&lt;/a&gt;&lt;br&gt;
Project page: &lt;a href="https://basavaraj.dev/projects/ultimate-ai-agent" rel="noopener noreferrer"&gt;basavaraj.dev/projects/ultimate-ai-agent&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you're building something similar or want to talk architecture, find me at &lt;a href="https://github.com/basavarajpatil660" rel="noopener noreferrer"&gt;@basavaraj_nick&lt;/a&gt; or drop a comment below.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>cloudflare</category>
      <category>showdev</category>
    </item>
    <item>
      <title>How I built a production AI agent system on zero budget (and what free tiers actually break first)</title>
      <dc:creator>Basavaraj Patil</dc:creator>
      <pubDate>Wed, 08 Jul 2026 23:04:17 +0000</pubDate>
      <link>https://dev.to/basavarajpatil660/how-i-built-a-production-ai-agent-system-on-zero-budget-and-what-free-tiers-actually-break-first-1769</link>
      <guid>https://dev.to/basavarajpatil660/how-i-built-a-production-ai-agent-system-on-zero-budget-and-what-free-tiers-actually-break-first-1769</guid>
      <description>&lt;p&gt;I'm a CS diploma student, and a few months back I set myself a constraint: build a real, always-on AI system, and don't spend a single rupee on infrastructure. No paid APIs, no paid hosting, nothing.&lt;br&gt;
What came out of it is Ultimate AI Agent — a multi-agent system that runs entirely through Telegram. No web dashboard needed day to day, you just chat with it.&lt;br&gt;
Here's what it does, and more importantly, what I learned about where free tiers actually break.&lt;br&gt;
The setup&lt;br&gt;
Everything lives on Cloudflare Workers, with GitHub Actions handling anything that needs to run on a schedule. The bot has 14+ commands and actually remembers recent conversation context — most toy Telegram bots don't bother with that part, but it's what makes it feel like an assistant instead of a command parser.&lt;/p&gt;

&lt;p&gt;It can generate images (FLUX as the primary model, with a fallback so it doesn't just die when FLUX is rate-limited), pull in live web research through Tavily and Jina, and runs 8 sub-agents on autopilot — a daily AI/tech news briefing, a YouTube trend report, that kind of thing.&lt;/p&gt;

&lt;p&gt;The thing nobody warns you about: rate limits, not compute&lt;br&gt;
Going in, I assumed compute or request limits would be the wall I'd hit. They weren't.&lt;/p&gt;

&lt;p&gt;The real bottleneck on free tiers is almost always LLM API rate limits — you get maybe a few hundred requests a day per provider before you're throttled, and that adds up fast if the bot is chatty.&lt;br&gt;
The fix that actually worked: chain multiple providers instead of relying on one.&lt;br&gt;
Cerebras → Groq → Mistral → OpenRouter → Gemini&lt;br&gt;
If the first provider is rate-limited or errors out, the request just falls through to the next one. It's a simple try/catch chain, nothing fancy, but it's the single biggest reason this thing stays up 24/7 without me babysitting it.&lt;/p&gt;

&lt;p&gt;Cloudflare KV + D1 cover more than you'd think&lt;br&gt;
I expected to need a "real" database pretty quickly. Turns out Cloudflare KV (for fast key-value memory, like recent conversation context) plus D1 (for structured stuff — commands, logs, automation runs) covers almost everything a small-to-medium bot needs, as long as you're deliberate about what goes where. KV for anything read-heavy and short-lived, D1 for anything you actually want to query later.&lt;/p&gt;

&lt;p&gt;GitHub Actions as a free cron service&lt;br&gt;
This one felt like cheating a little. Instead of paying for a server to run scheduled jobs, GitHub Actions cron triggers handle all 8 sub-agents — news briefings, trend reports, whatever needs to run daily. It's not built for this, but it works, and it's free.&lt;/p&gt;

&lt;p&gt;What I'd tell someone trying this&lt;br&gt;
Design for provider failure from day one. Don't build around one LLM API and add fallback later — build the chain first.&lt;br&gt;
Separate your memory into "needs to be fast" (KV) vs "needs to be queryable" (D1) early, or you'll end up refactoring.&lt;br&gt;
Free tiers are genuinely enough for a real, working product — the constraint pushes you toward better architecture, not worse.&lt;/p&gt;

&lt;p&gt;If you want to see the code, it's open: github.com/basavarajpatil660/Ultimate-Ai&lt;br&gt;
More of what I'm building: basavaraj.dev&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnic75ar61khaad5edew1.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnic75ar61khaad5edew1.jpeg" alt=" " width="800" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>serverless</category>
      <category>cloudflarechallenge</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
