I Replaced ₹4,000/Month of AI API Bills With One Self-Hosted Platform

How to deploy Python / Flask Web Applications? - DEV Community
TL;DR: Jaika is a free, self-hosted AI platform with 50+ REST endpoints covering chat, voice, RAG, file handling, and memory. Compatible with OpenAI/Anthropic SDKs. Runs on Google Gemini’s free tier. github.com/goyaljai/jaika

Context: I build a lot of small AI-powered tools. Side projects, experiments, things I use personally. Each one needs chat, maybe voice, file uploads, some memory layer. By the time you wire together OpenAI for chat, ElevenLabs for voice, a RAG pipeline, and session management, you’re looking at ₹3,000–5,000 a month in API costs just for personal-use volume.

That gets old fast. So I built Jaika.

What’s in it

Chat: Multi-model fallback — Gemini 2.5 Flash → Flash Lite → 3.x variants, with automatic switching on failure. Per-user personas replace system prompts. LangChain pipelines with RAG and web grounding via SerpAPI.

Voice: Real-time voice chat with VAD (voice activity detection) that auto-stops recording when you stop talking. ElevenLabs TTS with cloned voice support. Gemini Flash handles transcription. Works in the browser without setup.

Files: Upload images, PDFs, and audio for AI processing. AI-powered document generation — HTML pages, code files, reports from a prompt. Image generation via Imagen, video via Veo 2.

Memory: Per-user session memory that persists context across conversations. Users’ preferences and history carry forward — it’s not stateless chat.

The part that matters most for developers

Jaika exposes a compatibility layer for OpenAI and Anthropic SDKs. If you have existing code using the OpenAI Python client, you can point it at Jaika and it works without changing your application code. 50+ REST endpoints total — full coverage for the common AI application stack.

Cost in practice

Running on Gemini’s free tier: effectively ₹0/month for personal use. ElevenLabs has a free tier for voice. You’re only paying if you push serious traffic — and even paid Gemini tiers are cheap compared to equivalent OpenAI or Anthropic usage at the same volume.

Setup

git clone https://github.com/goyaljai/jaika
cd jaika
python3 -m venv venv && source venv/bin/activate
pip install -r requirements.txt
cp .env.example .env   # fill in Google OAuth + Gemini API key
python3 app.py

For production: Gunicorn behind nginx. The .env takes Google OAuth credentials (for auth), a Gemini API key, and optionally ElevenLabs for voice. Stack is Python 3.10, Flask, LangChain, Google Gemini API, Google OAuth 2.0.

MIT licensed. If you build AI-powered tools and are tired of per-API billing, this is worth a look. Repo at github.com/goyaljai/jaika.

Frequently Asked Questions

What is Jaika?

Jaika is a free, self-hosted AI platform with 50+ REST endpoints covering chat, voice, file handling, memory, and content generation. It runs on Google Gemini’s free tier and is compatible with OpenAI and Anthropic SDKs.

How much does Jaika cost to run?

Effectively zero for personal use. Jaika runs on Google Gemini’s free tier. ElevenLabs voice has a free tier too. You only pay if you push significant traffic — compared to $20–$100/month for hosted equivalents.

Can I use Jaika with existing OpenAI API code?

Yes. Jaika exposes an OpenAI-compatible layer, so existing code using the OpenAI Python client can be pointed at Jaika without changing application code.

What are the system requirements for self-hosting Jaika?

Python 3.10+, Flask, LangChain, and a Google Gemini API key. Runs on a basic VPS. No heavy infrastructure required — just clone the repo, fill in .env, and run python3 app.py.

Find more of my work:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Share