
Build Your First AI App in a Weekend (India Edition)
A complete beginner path from zero to a working AI app — a document Q&A tool — built and deployed over a weekend, with the total real cost in rupees at the end.
Author
AICredits Team
Published
13 Oct 2026
Reading time
8 min read
What we're building
A document Q&A app: upload a text file, ask questions about it, get answers grounded in that document. It's a small enough scope to finish in a weekend and a real enough pattern that the same structure extends to support bots, internal tools, and research assistants later.
Saturday: backend and the AI logic
Setup (30 minutes). Sign up at aicredits.in, top up ₹50 via UPI, and create an API key. No international card needed at any step.
mkdir doc-qa-app && cd doc-qa-app
python -m venv venv && source venv/bin/activate
pip install fastapi uvicorn openai python-multipartThe core logic (2-3 hours). For a single-document use case, you don't need a vector database yet — just pass the whole document as context if it fits the model's window, which it will for anything under a few dozen pages on most models:
# main.py
from fastapi import FastAPI, UploadFile, Form
from openai import OpenAI
app = FastAPI()
client = OpenAI(base_url="https://api.aicredits.in/v1", api_key="sk-your-aicredits-key")
documents: dict[str, str] = {} # in-memory store, fine for a weekend project
@app.post("/upload")
async def upload_doc(file: UploadFile):
content = (await file.read()).decode("utf-8")
documents["current"] = content
return {"status": "uploaded", "length": len(content)}
@app.post("/ask")
async def ask(question: str = Form(...)):
doc = documents.get("current", "")
response = client.chat.completions.create(
model="google/gemini-2.0-flash",
messages=[
{"role": "system", "content": f"Answer questions using only this document:\n\n{doc}"},
{"role": "user", "content": question},
],
)
return {"answer": response.choices[0].message.content}Testing it (1 hour). Run uvicorn main:app --reload and test with curl or the FastAPI auto-generated docs at /docs before building any frontend — confirm the AI logic works before spending time on UI.
Sunday: a simple frontend and deployment
Frontend (2-3 hours). A minimal HTML page is enough — no framework required for a weekend scope:
<!DOCTYPE html>
<html>
<body>
<input type="file" id="fileInput" />
<button onclick="upload()">Upload</button>
<input type="text" id="question" placeholder="Ask a question..." />
<button onclick="ask()">Ask</button>
<p id="answer"></p>
<script>
async function upload() {
const file = document.getElementById("fileInput").files[0];
const formData = new FormData();
formData.append("file", file);
await fetch("http://localhost:8000/upload", { method: "POST", body: formData });
alert("Uploaded");
}
async function ask() {
const question = document.getElementById("question").value;
const formData = new FormData();
formData.append("question", question);
const res = await fetch("http://localhost:8000/ask", { method: "POST", body: formData });
const data = await res.json();
document.getElementById("answer").innerText = data.answer;
}
</script>
</body>
</html>Deployment (1-2 hours). Deploy the FastAPI backend to any free-tier host that supports Python (Railway, Render, Fly.io all have workable free tiers for small projects), and serve the static HTML from the same host or a static host like Netlify. Set your AICredits key as an environment variable, never hardcoded in committed code.
What this actually cost, end to end
Testing across the weekend — uploading a few documents, asking dozens of questions during development, plus demo traffic afterward — on Gemini 2.0 Flash:
| Activity | Approx. tokens | Approx. cost | |----------|-------------------|----------------| | ~50 development test queries (avg. 1,500 input incl. document, 100 output) | ~80,000 | ~₹0.35 | | ~20 demo queries after deployment | ~32,000 | ~₹0.14 | | Total for the whole weekend | | under ₹1 |
The ₹50 topup from Saturday morning has, realistically, over a hundred weekends of headroom left in it at this usage level.
Where to go from here
Once this pattern works, the natural next steps are: swap the in-memory document store for a real vector database and add proper RAG for multi-document search (see RAG Explained), add streaming so answers appear token-by-token instead of all at once (see Streaming LLM Responses in Python), and add a proper auth layer if you're deploying this for anyone beyond yourself.
Frequently Asked Questions
Do I need to know machine learning to build this?
No — this uses an LLM via API, not training a model. The skills needed are standard web development: HTTP requests, basic backend routing, and simple frontend JavaScript.
What if my document is too long for the model's context window?
Switch to a model with a larger context window (Gemini 1.5 Pro handles very long documents well), or move to a proper RAG setup that retrieves only relevant chunks instead of sending the whole document every time.
Is ₹50 really enough for a full weekend of development?
Yes, comfortably, on a budget model like Gemini 2.0 Flash or GPT-4o-mini — the numbers above reflect realistic development-plus-demo usage, not a hypothetical minimum.
Get started
- Create a free account and top up ₹50 via UPI to start this project today.
- Follow the quickstart guide for the full API reference.
- Related: RAG Explained: Build an AI That Knows Your Own Data.
Related Articles
Continue in Docs
Need implementation commands and endpoint details? Go to quickstart or API reference.