I successfully built a custom AI chatbot for my father's prison tablet
Prison tablets are notoriously restricted, typically limiting users to basic messaging and a handful of approved applications. My dad's device was no exception, remaining completely isolated from the modern web and real-time assistance. Rather than providing just another way to send emails, I wanted to offer a tool for mental stimulation and learning. This motivated me to develop a custom AI chatbot capable of operating within his system's strict constraints.
Why the tablet's walled garden blocked AI
The primary technical hurdle was the hardware's walled garden nature. Because I could not simply install an APK or access a browser, I needed a way to bridge a powerful LLM with his limited interface. I developed a lightweight API wrapper designed to handle requests and return concise, high-value information without crashing the low-spec tablet or triggering strict data limits.
How I structured the AI deployment
For those interested in a similar AI workflow, here is how I structured the deployment:
- Backend Setup: I used a Python-based FastAPI server as an intermediary. This server connects to the LLM API and cleans the output to ensure compatibility with the tablet's text rendering.
- Prompt Engineering: This was the most critical component. I created a system prompt that forced the AI to be extremely concise, which is necessary because prison tablets often have slow loading speeds or character limits.
- Deployment: I hosted the backend on a small VPS to maintain 24/7 availability despite the tablet's intermittent connection.
Core logic for keeping responses within limits
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 fundamentally changed how he spends his time. Instead of merely waiting for mail, he uses the bot as a practical tutorial to explore subjects and topics that were previously inaccessible. This transforms the tablet from a surveillance tool into a legitimate educational device. Seeing him dive into history or science through a prompt-based interface proves that LLM agents can provide immense value even in highly restrictive environments. It serves as a real-world example of how custom coding can break down barriers to information.
All Replies (4)
Want a live back-and-forth? Join the global AI chat room — login to talk.
I'm curious about the LLM choice. Are you using a quantized version to keep the speed up?
Llama 3 8B is great, but does 4-bit quant actually hold up on limited hardware?