Skip to content
DanNobyPublic

About

Context-aware AI buddy in the terminal.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

12 Commits

Folders and files

Repository files navigation

TermiBot

TermiBot is a lightweight, prod-ready chat backend API built using FastAPI and Docker, designed to accept raw text input and return plain-text responses. It is deployed on Render with environment-based configuration and custom domain support.

The project was my forte into backend development, API design, containerization, and cloud deployment.

Demo

TermiBot Demo

Tech Stack

  • FastAPI – async Python backend, REST API design

  • Docker – containerized development and deployment

  • Google Gemini API – LLM integration via environment variables

  • Render – cloud deployment, CI/CD, HTTPS hosting

  • Environment Variables (.env) – secure secret management

  • curl / API testing – backend testing and debugging

  • Cloudflare DNS – custom domain routing

  • Linux / CLI workflows

Features

  • No JSON required (I/O using plaintext)
  • Preserves formatting for multi-line text and code
  • Async request handling
  • Fully Dockerized for portability
  • Live deployment with HTTPS
  • Interactive terminal chat client – chat directly from your terminal

Terminal Chat Client

A lightweight Python CLI client that connects to the TermiBot API for an interactive chat experience right in your terminal.

Quick start:

curl -o termichat.py https://chat.dannoby.xyz/client

python3 termichat.py

Features:

  • Interactive REPL-style chat interface
  • Commands: quit, exit, clear, help
  • Error handling for connection issues and timeouts
  • Cross-platform (macOS, Linux, Windows)

API Usage

Endpoint: POST /

Request (raw text):

curl -X POST https://chat.dannoby.xyz/ -d "Explain Docker in simple terms"

Response (plain text):


Imagine you want to bake a cake for a friend. You have your recipe and all the ingredients. But what if your friend has a different oven, or different sized bowls, or runs out of flour? Your cake might not turn out the same way at their house.

Docker solves this problem for software, like a standardized, self-contained baking kit.

Here's the breakdown: ....

If the model returns code, formatting is preserved.

Running Locally (Without Docker)

1. Create a .env file:

GEMINI_API_KEY = your_api_key_here

2. Install dependencies:

pip install -r requirements.txt

3. Run the server:

uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload

4. Test:

curl -X POST http://localhost:8000/ -d "Hello"

Running Locally (With Docker)

Build the image:

docker build -t termichat-backend .

Run the container:

docker run -p 8000:8000 --env-file .env termichat-backend

Test:

curl -X POST http://localhost:8000/ -d "Hello"

Deployment

  • Deployed on Render as a Dockerized Web Service
  • Environment variables configured via Render dashboard
  • Custom domain routed using Cloudflare DNS
  • HTTPS enabled automatically by Render

To Note

  • The Gemini API free tier has daily request limits.
  • If quota is exceeded, the API returns a 429 error from Gemini.

Future Improvements

  • Frontend UI integration
  • Streaming responses
  • Rate limiting & request validation
  • Authentication layer
  • Multi-model support

About

Context-aware AI buddy in the terminal.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages