<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Meet Nandu on Medium]]></title>
        <description><![CDATA[Stories by Meet Nandu on Medium]]></description>
        <link>https://medium.com/@meetnandu996?source=rss-4fcb8477026e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*CNZO_BsCZFm5zYxIbDEw0g.png</url>
            <title>Stories by Meet Nandu on Medium</title>
            <link>https://medium.com/@meetnandu996?source=rss-4fcb8477026e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 08:56:17 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@meetnandu996/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Building Production-Ready AI Applications (Part 5): Deploying to the Internet for Free]]></title>
            <link>https://medium.com/@meetnandu996/building-production-ready-ai-applications-part-5-deploying-to-the-internet-for-free-fe4201f30df7?source=rss-4fcb8477026e------2</link>
            <guid isPermaLink="false">https://medium.com/p/fe4201f30df7</guid>
            <category><![CDATA[llm-applications]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Meet Nandu]]></dc:creator>
            <pubDate>Sat, 31 Oct 2026 21:16:36 GMT</pubDate>
            <atom:updated>2026-10-31T21:16:36.698Z</atom:updated>
            <content:encoded><![CDATA[<p><em>This is Part 5 (the finale!) of a five-part series on building production-ready AI applications. In </em><a href="https://medium.com/@meetnandu996/building-production-ready-ai-applications-part-1-setting-up-your-free-ai-development-environment-ad7fe8d9bf40"><em>Part 1</em></a><em>, we set up our local LLM. In </em><a href="https://medium.com/@meetnandu996/building-production-ready-ai-applications-part-2-prompt-engineering-with-local-models-f4d10a5d0e5c"><em>Part 2</em></a><em>, we mastered prompt engineering. In </em><a href="https://medium.com/@meetnandu996/building-production-ready-ai-applications-part-3-building-rag-systems-with-chromadb-c3ff2568f9d7"><em>Part 3</em></a><em>, we built a RAG backend. In </em><a href="https://medium.com/@meetnandu996/building-production-ready-ai-applications-part-4-building-the-frontend-connecting-everything-a347b94a83ad"><em>Part 4</em></a><em>, we built the frontend and connected everything.</em></p><p><em>Today, we’re taking DocuChat from your laptop to the internet.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uCZke9JCQTcZuQjsLdvWHA.png" /><figcaption><em>From localhost to the internet — deploying a full AI application for $0</em></figcaption></figure><h3>What You’ll Learn</h3><ul><li>Why you can’t just deploy Ollama to a free hosting provider (and what to use instead)</li><li>Adding a cloud LLM provider (Groq) while keeping local Ollama for development</li><li>Environment variables and configuration management</li><li>Dockerizing the application</li><li>Deploying to Render’s free tier</li><li>Handling the free-tier sleep/wake cycle</li><li>Getting a live URL to share with anyone</li></ul><h3>The Deployment Problem</h3><p>Here’s the thing nobody tells you in most “deploy your AI app” tutorials: <strong>you can’t deploy Ollama to Render’s free tier</strong>.</p><p>Ollama needs:</p><ul><li><strong>Several GB of RAM</strong> to load even a small model (llama3.2 needs ~4GB)</li><li><strong>CPU/GPU power</strong> to run inference</li></ul><p>Render’s free tier gives you:</p><ul><li><strong>512MB RAM</strong></li><li><strong>0.1 CPU</strong></li></ul><p>That’s not even close. And this isn’t a Render problem — no free hosting platform gives you enough resources to run an LLM locally.</p><h3>The Solution: Swap the LLM at Deployment Time</h3><p>We’ll use a <strong>cloud LLM API</strong> for the deployed version. The best free option right now is <a href="https://groq.com/">Groq</a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1014/1*BbFXbjMpfbJbAaosGCAk4A.png" /></figure><p>The architecture stays the same — we just swap what answers the questions:</p><pre>LOCAL DEVELOPMENT:<br>  Browser → FastAPI → ChromaDB → Ollama (local)<br><br>DEPLOYED:<br>  Browser → FastAPI → ChromaDB → Groq API (cloud)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KdyfabyXPJjj7jFk3J3oCA.png" /><figcaption><em>Architecture comparison: Local development uses Ollama (4GB RAM) for generation. Deployed version swaps to Groq’s free API — everything else stays the same.</em></figcaption></figure><p>The key insight: <strong>the retrieval part (ChromaDB, embeddings) still runs locally on the server</strong>. Only the generation step changes. This means our RAG quality stays the same — we’re just using a different brain to synthesize the answer.</p><h3>Step 1: Get a Groq API Key</h3><ol><li>Go to <a href="https://console.groq.com/">console.groq.com</a></li><li>Sign up (free, no credit card)</li><li>Go to <strong>API Keys</strong> → <strong>Create API Key</strong></li><li>Copy and save the key — you’ll need it soon</li></ol><p>Groq’s free tier gives you models like GPT-OSS 20B at 1000 tokens/sec, which is more than enough for a demo app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I8PG5bOTE601kAZcCkMa2A.png" /><figcaption><em>Groq console — create a free API key at console.groq.com/keys</em></figcaption></figure><h3>Step 2: Make the App Provider-Agnostic</h3><p>Right now, rag_engine.py hardcodes ollama.chat(). We need it to use Ollama locally and Groq when deployed. The cleanest way: <strong>an environment variable that picks the provider</strong>.</p><p>Create a new file called llm_provider.py:</p><pre>&quot;&quot;&quot;<br>LLM Provider abstraction.<br>Uses Ollama locally, Groq API when deployed.<br>Controlled by LLM_PROVIDER environment variable.<br>&quot;&quot;&quot;<br>import os<br><br>def get_llm_response(messages: list, model: str = None, temperature: float = 0.3) -&gt; str:<br>    &quot;&quot;&quot;<br>    Get a response from the configured LLM provider.<br>    <br>    Args:<br>        messages: List of message dicts with &#39;role&#39; and &#39;content&#39;<br>        model: Model name (defaults based on provider)<br>        temperature: Response temperature<br>    <br>    Returns:<br>        The assistant&#39;s response text<br>    &quot;&quot;&quot;<br>    provider = os.getenv(&quot;LLM_PROVIDER&quot;, &quot;ollama&quot;).lower()<br>    <br>    if provider == &quot;groq&quot;:<br>        return _groq_chat(messages, model or &quot;openai/gpt-oss-20b&quot;, temperature)<br>    else:<br>        return _ollama_chat(messages, model or &quot;llama3.2&quot;, temperature)<br><br>def _ollama_chat(messages: list, model: str, temperature: float) -&gt; str:<br>    &quot;&quot;&quot;Local Ollama inference&quot;&quot;&quot;<br>    import ollama<br>    <br>    response = ollama.chat(<br>        model=model,<br>        messages=messages,<br>        options={&quot;temperature&quot;: temperature}<br>    )<br>    return response[&quot;message&quot;][&quot;content&quot;]<br><br>def _groq_chat(messages: list, model: str, temperature: float) -&gt; str:<br>    &quot;&quot;&quot;Groq cloud inference&quot;&quot;&quot;<br>    import requests<br>    <br>    api_key = os.getenv(&quot;GROQ_API_KEY&quot;)<br>    if not api_key:<br>        raise ValueError(&quot;GROQ_API_KEY environment variable is required when using Groq provider&quot;)<br>    <br>    response = requests.post(<br>        &quot;https://api.groq.com/openai/v1/chat/completions&quot;,<br>        headers={<br>            &quot;Authorization&quot;: f&quot;Bearer {api_key}&quot;,<br>            &quot;Content-Type&quot;: &quot;application/json&quot;<br>        },<br>        json={<br>            &quot;model&quot;: model,<br>            &quot;messages&quot;: messages,<br>            &quot;temperature&quot;: temperature,<br>            &quot;max_tokens&quot;: 1024<br>        },<br>        timeout=30<br>    )<br>    <br>    response.raise_for_status()<br>    return response.json()[&quot;choices&quot;][0][&quot;message&quot;][&quot;content&quot;]</pre><p><strong>Design decisions:</strong></p><ul><li><strong>Lazy imports</strong> — import ollama only runs when you actually use Ollama. This means the deployed version never tries to import (or install) the ollama package.</li><li><strong>Standard OpenAI-compatible API</strong> — Groq uses the OpenAI chat completions format, so switching to OpenAI, Together AI, or any other provider later is trivial.</li><li><strong>No new dependencies</strong> — We already have requests in our requirements. No SDK needed.</li></ul><h3>Step 3: Update the RAG Engine</h3><p>Now update rag_engine.py to use our provider abstraction. Only one method changes — generate_answer:</p><pre># At the top, replace:<br>import ollama<br><br># With:<br>from llm_provider import get_llm_response</pre><p>Then update the generate_answer method:</p><pre>def generate_answer(self, query: str, contexts: list) -&gt; str:<br>    &quot;&quot;&quot;Generate answer using LLM with retrieved context&quot;&quot;&quot;<br>    <br>    context_text = &quot;\n\n&quot;.join([<br>        f&quot;[Context {i+1}]\n{ctx}&quot; <br>        for i, ctx in enumerate(contexts)<br>    ])<br><br>    prompt = f&quot;&quot;&quot;You are a helpful assistant answering questions about documents.<br>Use the following context to answer the question. If the answer cannot be found <br>in the context, say so clearly.<br><br>CONTEXT:<br>{context_text}<br><br>QUESTION: {query}<br><br>ANSWER (be concise and cite which context sections you used):&quot;&quot;&quot;<br><br>    messages = [<br>        {<br>            &quot;role&quot;: &quot;system&quot;,<br>            &quot;content&quot;: &quot;You are a helpful assistant that answers questions based on provided context. Always cite your sources.&quot;<br>        },<br>        {<br>            &quot;role&quot;: &quot;user&quot;, <br>            &quot;content&quot;: prompt<br>        }<br>    ]<br><br>    return get_llm_response(messages, model=self.model_name, temperature=0.3)</pre><p>Also update the __init__ to pick a sensible default model:</p><pre>import os<br><br>class RAGEngine:<br>    def __init__(self, model_name: str = None):<br>        self.processor = DocumentProcessor(chunk_size=500, chunk_overlap=50)<br>        self.vector_store = VectorStore()<br>        <br>        # Pick model based on provider<br>        if model_name:<br>            self.model_name = model_name<br>        elif os.getenv(&quot;LLM_PROVIDER&quot;, &quot;ollama&quot;) == &quot;groq&quot;:<br>            self.model_name = &quot;openai/gpt-oss-20b&quot;<br>        else:<br>            self.model_name = &quot;llama3.2&quot;<br>        <br>        print(f&quot;RAG Engine initialized with model: {self.model_name}&quot;)</pre><p><strong>That’s it.</strong> The rest of the RAG engine — document processing, vector search, source citations — stays exactly the same.</p><p>Test locally to make sure nothing broke:</p><pre># Should still work exactly as before<br>python rag_api.py</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EpbrFuERVs-BcflF98kBJQ.png" /><figcaption><em>Server running with Groq provider</em></figcaption></figure><p>Then test with Groq (optional, to verify before deploying):</p><pre>export LLM_PROVIDER=groq<br>export GROQ_API_KEY=your_key_here<br>python rag_api.py<br># Upload a PDF and ask a question — should work identically, just faster</pre><h3>Step 4: Production Hardening</h3><p>Before deploying, let’s handle some production concerns.</p><h3>Add Health Check and Error Recovery</h3><p>Update rag_api.py — add a health check endpoint and improve error handling:</p><pre>@app.get(&quot;/health&quot;)<br>def health_check():<br>    &quot;&quot;&quot;Health check for Render&quot;&quot;&quot;<br>    return {&quot;status&quot;: &quot;healthy&quot;, &quot;provider&quot;: os.getenv(&quot;LLM_PROVIDER&quot;, &quot;ollama&quot;)}</pre><h3>Pin Dependencies</h3><p>Replace requirements.txt with pinned versions. This prevents &quot;it worked yesterday&quot; surprises:</p><pre>fastapi==0.115.0<br>uvicorn==0.32.0<br>requests==2.32.3<br>chromadb==0.5.23<br>pypdf==5.1.0<br>sentence-transformers==3.3.1<br>python-multipart==0.0.17<br><br># Only needed for local development (Ollama)<br># ollama==0.4.4</pre><p>Notice ollama is commented out. On Render, we don&#39;t need it — and it pulls in heavy dependencies we&#39;d rather skip.</p><p>Create a separate requirements-deploy.txt for the deployed version:</p><pre>fastapi==0.115.0<br>uvicorn==0.32.0<br>requests==2.32.3<br>chromadb==0.5.23<br>pypdf==5.1.0<br>python-multipart==0.0.17</pre><p>Notice we removed <strong>both</strong> ollama and sentence-transformers from the deploy file. Ollama isn&#39;t needed because we use Groq. And sentence-transformers pulls in PyTorch (~1.5GB installed, ~400MB RAM at startup) — that alone blows past Render&#39;s 512MB free-tier limit.</p><p>Instead, we’ll use ChromaDB’s <strong>built-in embedder</strong>, which runs the same all-MiniLM-L6-v2 model via onnxruntime at ~100MB RAM. Same embedding quality, 4x less memory. More on this in a moment.</p><h3>Update the Vector Store for Lightweight Embeddings</h3><p>This is the key change that makes free-tier deployment possible. Update vector_store.py to conditionally use ChromaDB&#39;s built-in embedder when deployed:</p><pre>import chromadb<br>from chromadb.config import Settings<br>from typing import List, Dict<br>import os<br><br>class VectorStore:<br>    def __init__(self, collection_name: str = &quot;documents&quot;, persist_directory: str = &quot;./chroma_db&quot;):<br>        self.client = chromadb.PersistentClient(path=persist_directory)<br>        <br>        # When deployed, use ChromaDB&#39;s built-in embedder (onnxruntime, ~100MB)<br>        # Locally, use sentence-transformers (PyTorch, better quality but ~2GB)<br>        if os.getenv(&quot;LLM_PROVIDER&quot;) == &quot;groq&quot;:<br>            print(&quot;Using ChromaDB built-in embedder (lightweight)&quot;)<br>            self.embedding_model = None<br>        else:<br>            print(&quot;Loading embedding model...&quot;)<br>            from sentence_transformers import SentenceTransformer<br>            self.embedding_model = SentenceTransformer(&#39;all-MiniLM-L6-v2&#39;)<br>            print(&quot;Embedding model loaded!&quot;)<br>        <br>        self.collection = self.client.get_or_create_collection(<br>            name=collection_name,<br>            metadata={&quot;description&quot;: &quot;Document chunks for RAG&quot;}<br>        )</pre><p>The add_documents and search methods now branch on whether self.embedding_model exists:</p><pre>def add_documents(self, chunks, document_name):<br>    texts = [chunk[&#39;text&#39;] for chunk in chunks]<br>    ids = [f&quot;{document_name}_{chunk[&#39;id&#39;]}&quot; for chunk in chunks]<br>    metadatas = [...]  # same as before<br>    <br>    if self.embedding_model:<br>        embeddings = self.create_embeddings(texts)<br>        self.collection.add(embeddings=embeddings, documents=texts, ids=ids, metadatas=metadatas)<br>    else:<br>        # ChromaDB generates embeddings automatically<br>        self.collection.add(documents=texts, ids=ids, metadatas=metadatas)<br><br>def search(self, query, n_results=3):<br>    if self.embedding_model:<br>        query_embedding = self.create_embeddings([query])[0]<br>        return self.collection.query(query_embeddings=[query_embedding], n_results=n_results, ...)<br>    else:<br>        # ChromaDB handles embedding the query too<br>        return self.collection.query(query_texts=[query], n_results=n_results, ...)</pre><p><strong>Why this works:</strong> ChromaDB ships with a default embedding function that uses all-MiniLM-L6-v2 via onnxruntime. When you don&#39;t pass explicit embeddings, ChromaDB embeds the text automatically. Same model, same quality — just a lighter runtime (~100MB vs ~400MB for PyTorch).</p><p><strong>Why not always use the built-in embedder?</strong> If you’re running locally with plenty of RAM, sentence-transformers gives you more flexibility (easy to swap models, GPU acceleration, batch tuning). For a 512MB server, the built-in embedder is the right choice.</p><h3>Add Environment Configuration</h3><p>Create a .env.example file so others know what to configure:</p><pre># LLM Provider: &quot;ollama&quot; (local) or &quot;groq&quot; (cloud)<br>LLM_PROVIDER=ollama<br><br># Required when LLM_PROVIDER=groq<br>GROQ_API_KEY=your_groq_api_key_here<br><br># Server configuration<br>PORT=8000<br>HOST=0.0.0.0</pre><p>Update your .gitignore to keep secrets out of Git:</p><pre>.env<br>venv/<br>uploads/<br>__pycache__/<br>chroma_db/<br>*.pyc</pre><h3>Step 5: Dockerize (Optional but Recommended)</h3><p>Docker ensures “it works on my machine” actually means “it works everywhere.”</p><p>Create a Dockerfile:</p><pre>FROM python:3.11-slim<br><br>WORKDIR /app<br><br># Install system dependencies<br>RUN apt-get update &amp;&amp; apt-get install -y \<br>    build-essential \<br>    &amp;&amp; rm -rf /var/lib/apt/lists/*<br># Copy requirements first (Docker layer caching)<br>COPY requirements-deploy.txt .<br>RUN pip install --no-cache-dir -r requirements-deploy.txt<br><br># Copy application code<br>COPY . .<br><br># Create uploads directory<br>RUN mkdir -p uploads<br><br># Expose port<br>EXPOSE 8000<br><br># Start server<br>CMD [&quot;uvicorn&quot;, &quot;rag_api:app&quot;, &quot;--host&quot;, &quot;0.0.0.0&quot;, &quot;--port&quot;, &quot;8000&quot;]</pre><p><strong>Why </strong><strong>python:3.11-slim?</strong> The slim variant is ~150MB vs ~1GB for the full image. We add build-essential for packages that need C compilation (like ChromaDB&#39;s native extensions).</p><p><strong>Important:</strong> Create a .dockerignore file to prevent your venv/ (which can be 1.5GB+) from being sent to Docker:</p><pre>venv/<br>__pycache__/<br>chroma_db/<br>uploads/<br>.env<br>*.pyc<br>.git/</pre><p>Without this, docker build will spend minutes just transferring your virtual environment — only to throw it away and install fresh inside the container.</p><p>Test locally:</p><pre>docker build -t docuchat .<br>docker run -p 8000:8000 -e LLM_PROVIDER=groq -e GROQ_API_KEY=your_key docuchat</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eppe09uvJ0w7DEKzJ8gdfQ.png" /><figcaption><em>Docker build completes in ~1 second (cached layers) and server starts with Groq provider</em></figcaption></figure><h3>Step 6: Deploy to Render</h3><h3>Option A: Deploy from GitHub (Recommended)</h3><ol><li>Push your code to GitHub:</li></ol><pre>git add -A<br>git commit -m &quot;feat: add deployment support with Groq provider&quot;<br>git push origin main</pre><ol><li>Go to <a href="https://dashboard.render.com/">dashboard.render.com</a> → <strong>New</strong> → <strong>Web Service</strong></li></ol><p>2. Connect your GitHub repository (this is mine — meetnandu05/docuchat)</p><p>3. Configure the service:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*E_S2tbjtTtcWYA8BNRiJIA.png" /><figcaption><em>Render Web Service configuration — Python runtime, free instance</em></figcaption></figure><p>| Setting | Value |<br>| Name | `docuchat` |<br>| Region | Oregon (US West) or nearest to you |<br>| Branch | `main` |<br>| Runtime | Python 3 |<br>| Build Command | `pip install -r requirements-deploy.txt` |<br>| Start Command | `uvicorn rag_api:app — host 0.0.0.0 — port $PORT` |<br>| Instance Type | Free |</p><p>4. Add <strong>Environment Variables</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/1*Qlk_vXWq9aS2g35BnOE-ig.png" /><figcaption><em>Environment variables — never hardcode API keys in your code</em></figcaption></figure><p>| Key | Value |<br>| `LLM_PROVIDER` | `groq` |<br>| `GROQ_API_KEY` | `your_actual_groq_key` |<br>| `PYTHON_VERSION` | `3.11.9` |</p><p>5. Click <strong>Create Web Service</strong></p><p>Render will build and deploy your app. First deploy takes 3–5 minutes. Subsequent deploys are faster thanks to build caching.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B1pVmNzm7iQjStWwpPweeg.png" /><figcaption><em>Build successful — your app is live!</em></figcaption></figure><h3>Option B: Deploy with Docker</h3><p>If you prefer Docker (more reproducible):</p><ol><li>In Render settings, change <strong>Environment</strong> to <strong>Docker</strong></li><li>Remove the Build/Start commands (Docker handles it)</li><li>Add the same environment variables</li><li>Deploy</li></ol><h3>Your Live URL</h3><p>Once deployed, you’ll get a URL like:</p><pre>https://docuchat-xxxx.onrender.com</pre><p>Open it in your browser — you should see the full DocuChat interface!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bjDxXryYHFB1AqgKrtAn3w.png" /><figcaption><em>DocuChat running on Render — upload a PDF, ask questions, get cited answers. All for $0.</em></figcaption></figure><h3>Step 7: Handle the Free-Tier Sleep Cycle</h3><p>Render’s free tier <strong>spins down your service after 15 minutes of no traffic</strong>. When someone visits after a sleep period, the first request takes ~30–60 seconds while the service wakes up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GEqhkJ7BpyvINPIeAvuE0Q.png" /><figcaption>Service waking up after inacticity</figcaption></figure><p>This is fine for a portfolio/demo app. But the user experience of staring at a blank page for 60 seconds isn’t great. Here are two ways to handle it:</p><h3>Option 1: Add a Loading State (Recommended)</h3><p>Update frontend/app.js — modify the init() function to show a friendly loading state:</p><pre>async function init() {<br>    try {<br>        // Show connecting state<br>        inputHint.textContent = &#39;⏳ Waking up the server (free tier may take ~30s)...&#39;;<br>        <br>        const response = await fetch(`${API_URL}/health`, {<br>            signal: AbortSignal.timeout(90000) // 90 second timeout for cold starts<br>        });<br>        <br>        if (!response.ok) throw new Error();<br>        <br>        inputHint.textContent = &#39;✅ Connected!&#39;;<br>    } catch (error) {<br>        showToast(&#39;Server is waking up. Please refresh in 30 seconds.&#39;, &#39;error&#39;);<br>        inputHint.textContent = &#39;😴 Server is sleeping. Refresh to wake it up.&#39;;<br>        return;<br>    }<br><br>    await refreshDocuments();<br>    await refreshStats();<br>}</pre><h3>Option 2: Keep-Alive Ping (Free, External)</h3><p>Use a free cron service like <a href="https://cron-job.org/">cron-job.org</a> to ping your /health endpoint every 14 minutes:</p><ol><li>Sign up at cron-job.org (free)</li><li>Create a new cron job:</li></ol><ul><li>URL: <a href="https://docuchat-xxxx.onrender.com/health">https://docuchat-xxxx.onrender.com/health</a></li><li>Schedule: Every 14 minutes</li></ul><p>This keeps your service awake during the day</p><p><strong>Caveat:</strong> Render gives 750 free hours/month. A 24/7 keep-alive uses ~744 hours, leaving almost no buffer. If you use keep-alive, set it only during your local daytime hours to save hours.</p><h3>Step 8: Final Project Structure</h3><p>Here’s the complete project after all five parts:</p><pre>docuchat/<br>├── frontend/<br>│   ├── index.html          (Part 4)<br>│   ├── styles.css          (Part 4)<br>│   └── app.js              (Part 4, updated for cold-start handling)<br>├── llm_provider.py         (Part 5 -- NEW)<br>├── rag_engine.py           (Part 3, updated to use llm_provider)<br>├── rag_api.py              (Part 3-4, with health check)<br>├── document_processor.py   (Part 3)<br>├── vector_store.py         (Part 3, updated for lightweight embeddings)<br>├── main.py                 (Part 1)<br>├── advanced_prompts.py     (Part 2)<br>├── Dockerfile              (Part 5 -- NEW)<br>├── .dockerignore           (Part 5 -- NEW)<br>├── requirements.txt        (Parts 1-4, with ollama + sentence-transformers)<br>├── requirements-deploy.txt (Part 5 -- NEW, lightweight for free tier)<br>├── .env.example            (Part 5 -- NEW)<br>├── .gitignore<br>└── README.md</pre><h3>Step 9: Test End-to-End</h3><p>Verify the deployed app works:</p><ol><li><strong>Open your Render URL</strong> — you should see the DocuChat UI</li><li><strong>Upload a PDF</strong> — drag-and-drop or click to browse</li><li><strong>Ask a question</strong> — type or click a suggestion</li><li><strong>Check the answer</strong> — it should have source citations, just like locally</li><li><strong>Share the URL</strong> — send it to a friend and have them try it!</li></ol><h3>What We Built: The Complete Series Recap</h3><p><strong>Part 1: </strong><a href="https://medium.com/@meetnandu996/building-production-ready-ai-applications-part-1-setting-up-your-free-ai-development-environment-ad7fe8d9bf40"><strong>Setting Up Your Free AI Development Environment</strong></a> Local LLM + FastAPI — Running AI locally with Ollama</p><p><strong>Part 2: </strong><a href="https://medium.com/@meetnandu996/building-production-ready-ai-applications-part-2-prompt-engineering-with-local-models-f4d10a5d0e5c"><strong>Prompt Engineering with Local Models</strong></a> Getting better answers from LLMs — zero-shot, few-shot, chain-of-thought, streaming</p><p><strong>Part 3: </strong><a href="https://medium.com/@meetnandu996/building-production-ready-ai-applications-part-3-building-rag-systems-with-chromadb-c3ff2568f9d7"><strong>Building RAG Systems with ChromaDB</strong></a> Teaching AI about your documents — ChromaDB, embeddings, source citations</p><p><strong>Part 4: </strong><a href="https://medium.com/@meetnandu996/building-production-ready-ai-applications-part-4-building-the-frontend-connecting-everything-a347b94a83ad"><strong>Building the Frontend &amp; Connecting Everything</strong></a> Making it usable by real humans — drag-and-drop upload, chat UI, cited answers</p><p><strong>Part 5: Deploying to the Internet for Free</strong> ← <em>you are here</em> Taking DocuChat live — Groq, Docker, Render free tier</p><p>The final tech stack:</p><ul><li><strong>LLM</strong>: Ollama (local) / Groq (deployed) — GPT-OSS 20B</li><li><strong>Backend</strong>: FastAPI + Python</li><li><strong>Vector DB</strong>: ChromaDB</li><li><strong>Embeddings</strong>: sentence-transformers / ChromaDB built-in (all-MiniLM-L6-v2)</li><li><strong>Frontend</strong>: Vanilla HTML/CSS/JS</li><li><strong>Hosting</strong>: Render (free tier)</li></ul><p>And the total cost? <strong>$0.</strong> Everything — the LLM, the hosting, the vector database, the embeddings — is completely free.</p><h3>Where to Go From Here</h3><p>This series gave you a solid foundation. Here’s what you could build next:</p><h3>Improve DocuChat</h3><ul><li><strong>Conversation memory</strong> — Send previous messages as context for follow-up questions</li><li><strong>Streaming responses</strong> — Show tokens as they arrive (Part 2’s streaming + frontend SSE)</li><li><strong>Multiple file formats</strong> — Add support for Word docs, text files, Markdown</li><li><strong>Better chunking</strong> — Use semantic chunking instead of fixed-size splits</li><li><strong>Authentication</strong> — Add user accounts so uploaded documents are private</li></ul><h3>Apply the Pattern Elsewhere</h3><p>The RAG architecture we built works for way more than PDF Q&amp;A:</p><ul><li><strong>Code documentation chatbot</strong> — Ingest your codebase, answer questions about it</li><li><strong>Customer support bot</strong> — Ingest your help docs, handle first-line support</li><li><strong>Research assistant</strong> — Ingest academic papers, synthesize across them</li><li><strong>Personal knowledge base</strong> — Ingest your notes, make them searchable</li></ul><h3>Go Deeper</h3><ul><li><strong>Fine-tuning</strong> — Train a model on your specific domain (Unsloth + QLoRA)</li><li><strong>Evaluation</strong> — Measure RAG quality with RAGAS or custom metrics</li><li><strong>Agents</strong> — Give the LLM tools (web search, calculations, database queries)</li><li><strong>Multi-modal</strong> — Process images and tables alongside text</li></ul><h3>Complete Code Repository</h3><p>All code is available on GitHub:</p><ul><li><strong>Branch</strong>: part-5-deployment</li><li><strong>New files</strong>: llm_provider.py, Dockerfile, .dockerignore, requirements-deploy.txt, .env.example</li><li><strong>Modified</strong>: rag_engine.py, rag_api.py, vector_store.py, requirements.txt, .gitignore</li></ul><p><strong>GitHub Repository</strong>: <a href="https://github.com/meetnandu05/docuchat">github.com/meetnandu05/docuchat</a></p><h3>Wrapping Up the Series</h3><p>When I started this series, the goal was simple: show that you can build a real, production-ready AI application using nothing but free tools. No GPT-4 API bill. No AWS instance. No $200/month vector database.</p><p>We went from ollama pull llama3.2 to a deployed application with document upload, semantic search, cited answers, and a polished UI — all for $0.</p><p>The AI landscape changes fast, but the fundamentals don’t:</p><ol><li><strong>Start local</strong> — Prototype with free, local tools before committing to paid services</li><li><strong>Build in layers</strong> — Each part of our stack is replaceable (swap Ollama for GPT-4, ChromaDB for Pinecone, Render for AWS — the architecture holds)</li><li><strong>Ship it</strong> — A deployed demo is worth a thousand README files</li></ol><p>Thanks for following along. If this series helped you build something, I’d love to hear about it — drop a comment or find me on <a href="https://www.linkedin.com/in/meet-nandu-05/">LinkedIn</a>.</p><p>Happy building! 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fe4201f30df7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building Production-Ready AI Applications (Part 4): Building the Frontend & Connecting Everything]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@meetnandu996/building-production-ready-ai-applications-part-4-building-the-frontend-connecting-everything-a347b94a83ad?source=rss-4fcb8477026e------2"><img src="https://cdn-images-1.medium.com/max/1408/1*Z3NVTtGYJTxXct6qPVp3dQ.png" width="1408"></a></p><p class="medium-feed-snippet">Welcome back! In Part 1, we set up our local LLM. In Part 2, we mastered prompt engineering. In Part 3, we built a RAG backend that can&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@meetnandu996/building-production-ready-ai-applications-part-4-building-the-frontend-connecting-everything-a347b94a83ad?source=rss-4fcb8477026e------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@meetnandu996/building-production-ready-ai-applications-part-4-building-the-frontend-connecting-everything-a347b94a83ad?source=rss-4fcb8477026e------2</link>
            <guid isPermaLink="false">https://medium.com/p/a347b94a83ad</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[rags]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Meet Nandu]]></dc:creator>
            <pubDate>Tue, 18 Aug 2026 04:51:59 GMT</pubDate>
            <atom:updated>2026-08-18T04:51:59.957Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Building Production-Ready AI Applications (Part 3): Building RAG Systems with ChromaDB]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@meetnandu996/building-production-ready-ai-applications-part-3-building-rag-systems-with-chromadb-c3ff2568f9d7?source=rss-4fcb8477026e------2"><img src="https://cdn-images-1.medium.com/max/1337/1*DBcZ5pXDNCM7vn009N-gfg.jpeg" width="1337"></a></p><p class="medium-feed-snippet">Welcome back! In Part 1, we set up our local LLM environment, and in Part 2, we mastered prompt engineering. Now comes the exciting part&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@meetnandu996/building-production-ready-ai-applications-part-3-building-rag-systems-with-chromadb-c3ff2568f9d7?source=rss-4fcb8477026e------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@meetnandu996/building-production-ready-ai-applications-part-3-building-rag-systems-with-chromadb-c3ff2568f9d7?source=rss-4fcb8477026e------2</link>
            <guid isPermaLink="false">https://medium.com/p/c3ff2568f9d7</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[retrieval-augmented]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Meet Nandu]]></dc:creator>
            <pubDate>Wed, 13 May 2026 05:41:08 GMT</pubDate>
            <atom:updated>2026-05-13T05:41:08.342Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Building Production-Ready AI Applications (Part 2): Prompt Engineering with Local Models]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@meetnandu996/building-production-ready-ai-applications-part-2-prompt-engineering-with-local-models-f4d10a5d0e5c?source=rss-4fcb8477026e------2"><img src="https://cdn-images-1.medium.com/max/1536/1*iYyNnwWb7yEooKmV93jmSA.jpeg" width="1536"></a></p><p class="medium-feed-snippet">Welcome back to the series! In Part 1, we set up our development environment with Ollama and built our first AI-powered API. Now it&#x2019;s time&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@meetnandu996/building-production-ready-ai-applications-part-2-prompt-engineering-with-local-models-f4d10a5d0e5c?source=rss-4fcb8477026e------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@meetnandu996/building-production-ready-ai-applications-part-2-prompt-engineering-with-local-models-f4d10a5d0e5c?source=rss-4fcb8477026e------2</link>
            <guid isPermaLink="false">https://medium.com/p/f4d10a5d0e5c</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[prompt-engineering]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Meet Nandu]]></dc:creator>
            <pubDate>Sun, 22 Mar 2026 20:45:39 GMT</pubDate>
            <atom:updated>2026-03-22T20:45:39.637Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Building Production-Ready AI Applications (Part 1): Setting Up Your Free AI Development Environment]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@meetnandu996/building-production-ready-ai-applications-part-1-setting-up-your-free-ai-development-environment-ad7fe8d9bf40?source=rss-4fcb8477026e------2"><img src="https://cdn-images-1.medium.com/max/2600/1*tTuxPshZauTRCUhvHDZsfA.jpeg" width="2765"></a></p><p class="medium-feed-snippet">Welcome to the first post in my series on building production-ready AI applications! Over the next several posts, we&#x2019;ll build a complete&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@meetnandu996/building-production-ready-ai-applications-part-1-setting-up-your-free-ai-development-environment-ad7fe8d9bf40?source=rss-4fcb8477026e------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@meetnandu996/building-production-ready-ai-applications-part-1-setting-up-your-free-ai-development-environment-ad7fe8d9bf40?source=rss-4fcb8477026e------2</link>
            <guid isPermaLink="false">https://medium.com/p/ad7fe8d9bf40</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[llm-applications]]></category>
            <dc:creator><![CDATA[Meet Nandu]]></dc:creator>
            <pubDate>Fri, 20 Feb 2026 03:12:43 GMT</pubDate>
            <atom:updated>2026-02-20T03:12:43.982Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Building ChatGPT-Style Applications: A Practical Guide to LLMs]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@meetnandu996/building-chatgpt-style-applications-a-practical-guide-to-llms-d43623ca5420?source=rss-4fcb8477026e------2"><img src="https://cdn-images-1.medium.com/max/832/1*X6alSo4339DyHsTYof3oQA.jpeg" width="832"></a></p><p class="medium-feed-snippet">&#x201C;Can you help me write an email?&#x201D; I asked ChatGPT last Tuesday, and within seconds, I had a perfectly crafted response ready to send. This&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@meetnandu996/building-chatgpt-style-applications-a-practical-guide-to-llms-d43623ca5420?source=rss-4fcb8477026e------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@meetnandu996/building-chatgpt-style-applications-a-practical-guide-to-llms-d43623ca5420?source=rss-4fcb8477026e------2</link>
            <guid isPermaLink="false">https://medium.com/p/d43623ca5420</guid>
            <category><![CDATA[llm-applications]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[chatgpt]]></category>
            <dc:creator><![CDATA[Meet Nandu]]></dc:creator>
            <pubDate>Sun, 14 Sep 2025 20:11:55 GMT</pubDate>
            <atom:updated>2025-09-14T20:11:55.623Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Credit Card Formatting Demystified: A Step-by-Step Blueprint]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@meetnandu996/credit-card-formatting-demystified-a-step-by-step-blueprint-6a69e847e8f2?source=rss-4fcb8477026e------2"><img src="https://cdn-images-1.medium.com/max/1061/0*ijGX26QfGxLyBunt.jpg" width="1061"></a></p><p class="medium-feed-snippet">In today&#x2019;s digital age, credit cards have become an indispensable part of our daily lives. From making online purchases to booking travel&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@meetnandu996/credit-card-formatting-demystified-a-step-by-step-blueprint-6a69e847e8f2?source=rss-4fcb8477026e------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@meetnandu996/credit-card-formatting-demystified-a-step-by-step-blueprint-6a69e847e8f2?source=rss-4fcb8477026e------2</link>
            <guid isPermaLink="false">https://medium.com/p/6a69e847e8f2</guid>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[credit-cards]]></category>
            <dc:creator><![CDATA[Meet Nandu]]></dc:creator>
            <pubDate>Mon, 16 Sep 2024 15:34:18 GMT</pubDate>
            <atom:updated>2024-09-16T15:34:18.219Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[What exactly is an AWS Lambda function?]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@meetnandu996/what-exactly-is-an-aws-lambda-function-87750c24387d?source=rss-4fcb8477026e------2"><img src="https://cdn-images-1.medium.com/max/875/0*yUQBr-6ErhIMcQp1.png" width="875"></a></p><p class="medium-feed-snippet">Almost all industries now rely on cloud computing to improve operational efficiency. By eliminating the restrictions of on-site legacy&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@meetnandu996/what-exactly-is-an-aws-lambda-function-87750c24387d?source=rss-4fcb8477026e------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@meetnandu996/what-exactly-is-an-aws-lambda-function-87750c24387d?source=rss-4fcb8477026e------2</link>
            <guid isPermaLink="false">https://medium.com/p/87750c24387d</guid>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Meet Nandu]]></dc:creator>
            <pubDate>Wed, 26 Jul 2023 06:05:35 GMT</pubDate>
            <atom:updated>2023-07-26T06:05:35.677Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Google FooBar: Google’s secret hiring process]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@meetnandu996/google-foobar-googles-secret-hiring-process-b63be49f7e53?source=rss-4fcb8477026e------2"><img src="https://cdn-images-1.medium.com/max/1920/1*PmvtuKOI5pCSW8EKYNp1lg.png" width="1920"></a></p><p class="medium-feed-snippet">Ever wondered what it feels like to be contacted by the world&#x2019;s biggest tech company for an invite only challenge?</p><p class="medium-feed-link"><a href="https://medium.com/@meetnandu996/google-foobar-googles-secret-hiring-process-b63be49f7e53?source=rss-4fcb8477026e------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@meetnandu996/google-foobar-googles-secret-hiring-process-b63be49f7e53?source=rss-4fcb8477026e------2</link>
            <guid isPermaLink="false">https://medium.com/p/b63be49f7e53</guid>
            <category><![CDATA[foobar-challenge]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Meet Nandu]]></dc:creator>
            <pubDate>Thu, 21 Apr 2022 02:19:10 GMT</pubDate>
            <atom:updated>2022-04-21T02:19:10.653Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Euro 2020 Final Twitter Analysis in Python — Part I]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/analytics-vidhya/euro-2020-final-twitter-analysis-in-python-part-i-3d84d667484?source=rss-4fcb8477026e------2"><img src="https://cdn-images-1.medium.com/max/700/0*shthhzvE3StLpJPQ.jpg" width="700"></a></p><p class="medium-feed-snippet">Can we guess how people feel around the world during a large sporting event? In this project, I will try to do just that.</p><p class="medium-feed-link"><a href="https://medium.com/analytics-vidhya/euro-2020-final-twitter-analysis-in-python-part-i-3d84d667484?source=rss-4fcb8477026e------2">Continue reading on Analytics Vidhya »</a></p></div>]]></description>
            <link>https://medium.com/analytics-vidhya/euro-2020-final-twitter-analysis-in-python-part-i-3d84d667484?source=rss-4fcb8477026e------2</link>
            <guid isPermaLink="false">https://medium.com/p/3d84d667484</guid>
            <category><![CDATA[uefa-euro-2020]]></category>
            <category><![CDATA[sentiment-analysis]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[twitter-analysis]]></category>
            <dc:creator><![CDATA[Meet Nandu]]></dc:creator>
            <pubDate>Sat, 17 Jul 2021 16:23:36 GMT</pubDate>
            <atom:updated>2022-04-14T15:21:44.425Z</atom:updated>
        </item>
    </channel>
</rss>