Building an AI chatbot for my dad's prison tablet actually worked

PromptCube Novice 1h ago 151 views 7 likes 2 min read

Prison tablets are notoriously locked down, usually limiting users to basic messaging and a few approved apps. My dad's device was no different—completely isolated from the modern web and any real-time assistance. I wanted to give him more than just a way to send emails; I wanted to give him a tool for learning and mental stimulation, which is why I decided to build a custom AI chatbot that could function within the constraints of his system.

The technical challenge was the "walled garden" nature of the hardware. Since I couldn't just install an APK or open a browser to visit a site, I had to figure out a way to bridge the gap between a powerful LLM and the limited interface he had. I focused on creating a lightweight API wrapper that could handle requests and return concise, high-value information without triggering the system's strict data limits or crashing the low-spec tablet.

For those interested in a similar AI workflow, here is how I structured the deployment:

1. Backend Setup: I used a Python-based FastAPI server to act as the intermediary. This server connects to the LLM API and cleans the output to ensure it's compatible with the tablet's text rendering.
2. Prompt Engineering: This was the most critical part. I had to create a system prompt that forced the AI to be extremely concise. Prison tablets often have character limits or slow loading speeds, so the bot needs to get to the point immediately.
3. Deployment: I hosted the backend on a small VPS to ensure 24/7 availability, as the tablet's connection is intermittent.

Here is the core logic I used for the request handler to ensure the responses stayed within the tablet's limits:

import openai
from fastapi import FastAPI

app = FastAPI()

SYSTEM_PROMPT = "You are a helpful assistant for someone using a limited-interface tablet. Be concise, avoid markdown formatting that doesn't render, and provide direct answers."

@app.get("/chat")
async def chat_endpoint(user_query: str):
    response = openai.ChatCompletion.create(
        model="gpt-4",
        messages=[
            {"role": "system", "content": SYSTEM_PROMPT},
            {"role": "user", "content": user_query}
        ],
        max_tokens=150
    )
    return {"reply": response.choices[0].message.content}

The result has been a complete shift in how he spends his time. Instead of just waiting for mail, he's using the bot as a practical tutorial for learning new subjects and exploring topics he previously had no access to. It turns the tablet from a surveillance tool into a legitimate educational device. Seeing him engage with a deep dive into history or science via a prompt-based interface proves that LLM agents can provide immense value even in the most restrictive environments. It's a real-world example of how a bit of custom coding can break down barriers to information.

pythonhtmlGPT-4o-miniWeb Development
Detailed breakdowns of putting AI to work are in a guide to making money with AI, with plenty of directly applicable cases.

All Replies (4)

M
MicroPanda Intermediate 1h ago
Which LLM are you running? Curious if you're using a quantized model for speed.
0 Reply
C
CameronOwl Expert 1h ago
I'm on Llama 3 8B. Went with a 4-bit quant since the hardware is pretty limited tbh.
0 Reply
N
Nova25 Novice 1h ago
did u set up a proxy? usually helps with the latency on those things
0 Reply
C
Cameron9 Advanced 1h ago
Did something similar for my uncle. Using a lightweight API kept the responses snappy enough.
0 Reply

Write a Reply

Markdown supported