🔗 Live Backend API: https://prmaster.onrender.com · Swagger docs An AI-powered "Senior Developer" partner that takes raw, unfiltered notes and transforms them into:
hactoberP1/
├── backend/ # FastAPI REST service
│ ├── app/
│ │ ├── main.py # CORS, health check & /api/polish
│ │ ├── schemas.py # Pydantic request / response models
│ │ ├── prompts.py # System prompts for each mode
│ │ └── services.py # OpenAI-compatible async LLM client
│ ├── test_main.py # Pytest async test suite
│ ├── Procfile # Render deployment entry point
│ └── requirements.txt
├── frontend/ # Streamlit web UI
│ ├── app.py # Reactive UI with tabs & diff view
│ ├── api_client.py # HTTP client for the FastAPI backend
│ ├── styles.py # Custom CSS
│ └── requirements.txt
├── PLANNER.md # Master phase planner
└── README.md
User → Streamlit → POST /api/polish → AsyncOpenAI client ← polished_text ←────────────── Groq / OpenRouter / Ollama
---
## ⚙️ Environment Variables
All three variables live in `backend/.env`. No code changes are needed to switch providers.
| Variable | Default | Description |
|---|---|---|
| `LLM_BASE_URL` | `https://api.groq.com/openai/v1` | Base URL of any OpenAI-compatible endpoint |
| `LLM_API_KEY` | *(required)* | API key for the chosen provider |
| `LLM_MODEL` | `llama-3.1-8b-instant` | Model ID as recognised by the provider |
| `LLM_FALLBACK_MODEL` | *(optional)* | Tried automatically if the primary model fails all retries |
| `PORT` | `8000` | Port the FastAPI server listens on |
---
## 🚀 Quickstart (Local)
### 1. Prerequisites
- Python 3.10+
- A Groq API key — free at [console.groq.com](https://console.groq.com) (no credit card needed)
### 2. Clone & create a virtual environment
```bash
git clone https://github.com/your-username/hactoberP1.git
cd hactoberP1
python -m venv venv
# Windows
.\venv\Scripts\activate
# macOS / Linux
source venv/bin/activate
pip install -r backend/requirements.txtCopy the example env file and fill in your key:
cp backend/.env.example backend/.env
# Open backend/.env and set LLM_API_KEY=<your_groq_key>Start the API:
# From the project root
cd backend
uvicorn app.main:app --reload --port 8000pip install -r frontend/requirements.txtcd frontend
streamlit run app.py- Install Ollama and pull a model:
ollama pull llama3.1- Set these vars in
backend/.env:
LLM_BASE_URL=http://localhost:11434/v1
LLM_API_KEY=ollama
LLM_MODEL=llama3.1- Start Ollama, then start the backend as normal. No internet connection required.
- Push the repo to GitHub.
- Create a new Web Service on render.com, point it at your repo.
- Set Root Directory to
backend. - Render auto-detects the
Procfile:web: uvicorn app.main:app --host 0.0.0.0 --port $PORT - Add environment variables in the Render dashboard:
LLM_API_KEY— your Groq keyLLM_BASE_URL—https://api.groq.com/openai/v1LLM_MODEL—llama-3.1-8b-instant
⚠️ Free tier cold start: Render spins down free services after ~15 minutes of inactivity. The first request after idle may take 30–60 seconds to respond while the container wakes up. Subsequent requests are fast.
-
Create a second Web Service on render.com, same repo.
-
Set Root Directory to
frontend. -
Render picks up
frontend/Procfileautomatically:web: streamlit run app.py --server.port $PORT --server.address 0.0.0.0 --server.headless true -
Set Build Command to
pip install -r requirements.txt. -
Add one environment variable in the Render dashboard:
Key Value BACKEND_API_URLhttps://prmaster.onrender.com -
Deploy — you'll get a public URL like
https://your-frontend.onrender.com.
cd backend
pytest test_main.py -vNeither .env file is committed (both are in .gitignore). Use the provided .env.example files as templates:
backend/.env.example— LLM provider configfrontend/.env.example— backend URL for the Streamlit client