Skip to content
PalakshiVermaPublic

About

An AI-powered developer productivity tool leveraging Python, FastAPI and LLM integration to streamline technical writing and enhance developer communication.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DevDraft: The Standup & PR Polish Agent

Hacktoberfest 2026 License: MIT

Built with FastAPI Streamlit Powered by Llama OpenAI-compatible Backend on Render

🔗 Live Backend API: https://prmaster.onrender.com · Swagger docs An AI-powered "Senior Developer" partner that takes raw, unfiltered notes and transforms them into:


Architecture

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



Data flow

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

3. Backend

pip install -r backend/requirements.txt

Copy 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 8000

Swagger docs: http://localhost:8000/docs

4. Frontend

pip install -r frontend/requirements.txt
cd frontend
streamlit run app.py

Open http://localhost:8501.


🦙 Local Mode with Ollama (fully offline, notes never leave your machine)

  1. Install Ollama and pull a model:
ollama pull llama3.1
  1. Set these vars in backend/.env:
LLM_BASE_URL=http://localhost:11434/v1
LLM_API_KEY=ollama
LLM_MODEL=llama3.1
  1. Start Ollama, then start the backend as normal. No internet connection required.

🌐 Deployment

Backend → Render (free tier)

  1. Push the repo to GitHub.
  2. Create a new Web Service on render.com, point it at your repo.
  3. Set Root Directory to backend.
  4. Render auto-detects the Procfile:
    web: uvicorn app.main:app --host 0.0.0.0 --port $PORT
    
  5. Add environment variables in the Render dashboard:
    • LLM_API_KEY — your Groq key
    • LLM_BASE_URL — https://api.groq.com/openai/v1
    • LLM_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.

Frontend → Render (free tier)

  1. Create a second Web Service on render.com, same repo.

  2. Set Root Directory to frontend.

  3. Render picks up frontend/Procfile automatically:

    web: streamlit run app.py --server.port $PORT --server.address 0.0.0.0 --server.headless true
    
  4. Set Build Command to pip install -r requirements.txt.

  5. Add one environment variable in the Render dashboard:

    Key Value
    BACKEND_API_URL https://prmaster.onrender.com
  6. Deploy — you'll get a public URL like https://your-frontend.onrender.com.


🧪 Running Tests

cd backend
pytest test_main.py -v

📁 .env files

Neither .env file is committed (both are in .gitignore). Use the provided .env.example files as templates:

  • backend/.env.example — LLM provider config
  • frontend/.env.example — backend URL for the Streamlit client

📄 License

MIT

About

An AI-powered developer productivity tool leveraging Python, FastAPI and LLM integration to streamline technical writing and enhance developer communication.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages