Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

Knight Hacks — Python AI Starter

A Python starter for projects using AI APIs (OpenAI, Gemini, Anthropic, HuggingFace). Perfect for AI/ML, data, or backend-focused hacks.

Stack

  • Python 3.10+
  • FastAPI — quick REST API backend
  • python-dotenv — for managing API keys safely
  • Pre-configured for OpenAI / Gemini / Anthropic

Quick Start

git clone https://github.com/knighthacks/hackathon-starter-python
cd hackathon-starter-python

python -m venv venv
source venv/bin/activate       # Mac/Linux
venv\Scripts\activate          # Windows

pip install -r requirements.txt
cp .env.example .env           # add your API keys here
python main.py

Server runs at http://localhost:8000

Project Structure

main.py              ← FastAPI app entry point
routes/
  chat.py            ← example AI chat endpoint
services/
  ai.py              ← AI API calls live here
.env.example         ← copy to .env, fill in your keys
requirements.txt

Adding AI APIs

In .env:

OPENAI_API_KEY=sk-...
GEMINI_API_KEY=...
ANTHROPIC_API_KEY=sk-ant-...

Deploy to Railway (free tier)

  1. Push to GitHub
  2. Go to railway.app → New Project → Deploy from GitHub
  3. Add your .env variables in the Railway dashboard
  4. Done — live URL ready to go!