A FastAPI service that analyzes GitHub repositories and generates intelligent summaries using Large Language Models (LLMs).
- Analyzes public GitHub repositories
- Web UI at
http://localhost:8000— no curl needed - Detailed summaries: overview, technologies, architecture, key features, use cases, and getting started guide
- Intelligent file filtering and prioritization
- Context-aware LLM prompting
- Support for multiple LLM providers (Nebius, Anthropic, OpenAI)
- GitHub token support to avoid API rate limits
- Comprehensive error handling
- RESTful API with proper HTTP status codes
- Python 3.10 or higher
- pip package manager
- Git (optional, for cloning)
- Download and extract the project (or clone if using git):
# If cloning:
git clone <your-repo-url>
cd github-summarizer
# If from zip:
unzip github-summarizer.zip
cd github-summarizer- Create a virtual environment (recommended):
python -m venv venv
# On macOS/Linux:
source venv/bin/activate
# On Windows:
venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Configure API keys:
Create a .env file in the project root:
# Copy the example file
cp .env.example .envThen edit .env and add your keys:
# LLM API key (required) — pick one:
NEBIUS_API_KEY=your-actual-nebius-api-key-here
# ANTHROPIC_API_KEY=your-actual-anthropic-api-key-here
# OPENAI_API_KEY=your-actual-openai-api-key-here
# GitHub token (recommended) — avoids GitHub API rate limits
# Generate at: https://github.com/settings/tokens
GITHUB_TOKEN=your-github-token-hereNote: Without a
GITHUB_TOKENyou are limited to 60 GitHub API requests per hour. With a token the limit rises to 5,000.
Note: The
.envfile is automatically ignored by git (see.gitignore) to keep your keys secure.
source venv/bin/activate
uvicorn main:app --host 0.0.0.0 --port 8000The server starts at http://localhost:8000. You should see:
INFO: Started server process
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://0.0.0.0:8000
Press Ctrl+C to stop it.
Open your browser and go to:
http://localhost:8000
Paste any public GitHub URL into the input box and click Summarize. Results appear on the page.
Endpoint: POST /summarize
curl -s -X POST http://localhost:8000/summarize \
-H "Content-Type: application/json" \
-d '{"github_url": "https://github.com/psf/requests"}' | python3 -m json.toolResponse (example):
{
"summary": "...",
"technologies": ["Python", "urllib3", "..."],
"structure": "...",
"key_features": ["...", "..."],
"architecture": "...",
"getting_started": "...",
"use_cases": ["...", "..."]
}Error Response:
{
"detail": "Repository not found or is private"
}curl http://localhost:8000/healthFastAPI provides a built-in UI for exploring the API:
http://localhost:8000/docs
Why this model?
- Specialized for code: Qwen3-Coder is specifically trained for code understanding and analysis
- Strong reasoning: Provides excellent analysis capabilities for diverse codebases
- Cost-effective: Available through Nebius AI Studio
- Fast: Optimized for quick responses while maintaining quality
The implementation also supports Anthropic Claude and OpenAI GPT-4 as alternatives.
-
Priority Files (always included):
- README files (README.md, README.rst, etc.)
- Package configuration (package.json, setup.py, pyproject.toml, Cargo.toml, etc.)
- Build files (Dockerfile, Makefile, docker-compose.yml)
- Architecture documentation (ARCHITECTURE.md, DESIGN.md)
-
Source Files (selectively):
- Root-level source files (up to 10 files)
- Main source files from primary directories (up to 15 files)
- Prioritizes common languages: .py, .js, .ts, .java, .go, .rs, .c, .cpp
-
Configuration Files (limited):
- Key config files like tsconfig.json, .eslintrc (up to 5 files)
-
Directory Structure:
- Complete file tree (filtered, limited to 100 items)
- Binary Files: Images, videos, audio, compiled binaries, archives, fonts
- Generated/Dependency Files:
node_modules/,__pycache__/, lock files, build artifacts - Environment/IDE Files:
.vscode/,.idea/, virtual environments
- Individual file limit: 5,000 characters (with truncation marker)
- Total context limit: ~100,000 characters across all files
- Smart selection: Priority files processed first
- Graceful degradation: System continues even if some files fail to fetch
.
├── main.py # FastAPI application, endpoints, and web UI
├── repo_analyzer.py # GitHub API integration and file filtering
├── llm_client.py # LLM API integration (multi-provider)
├── test_api.py # API test suite
├── requirements.txt # Python dependencies
└── README.md # This file
| HTTP Status | Meaning |
|---|---|
| 400 Bad Request | Invalid GitHub URL format |
| 404 Not Found | Repository doesn't exist or is private |
| 500 Internal Server Error | API key not configured or unexpected error |
| 503 Service Unavailable | Network error or LLM API unavailable |
LLM API key not configured
- Make sure
.envexists and containsNEBIUS_API_KEY,ANTHROPIC_API_KEY, orOPENAI_API_KEY
rate limit exceeded
- Add a
GITHUB_TOKENto your.envfile (see Setup)
Repository not found or is private
- Verify the URL is correct and the repository is public
Connection timeout
- Check your internet connection and try again
Module not found errors
- Make sure you activated your virtual environment:
source venv/bin/activate
This project is provided as-is for evaluation purposes.