How it works
The AI generation process follows a multi-step pipeline that extracts repository information and generates documentation:- Repository ingestion - GitIngest processes your repository and extracts content, structure, and metadata
- Content analysis - The system analyzes code files, directory structure, and project summary
- AI generation - Gemini 2.5 Pro generates a professional README based on the analysis
- Post-processing - The generated markdown is cleaned and formatted for immediate use
AI model
GitRead uses Google Gemini 2.5 Pro Preview (google/gemini-2.5-pro-preview-03-25) via OpenRouter:
Why Gemini 2.5 Pro?
- Large context window - Handles repositories with up to 900,000 tokens of content
- Code understanding - Trained specifically for technical and code-related tasks
- Quality output - Generates well-structured, accurate documentation
- Speed - Fast generation times for most repositories
Prompt engineering
The AI receives a carefully crafted prompt that includes:Repository summary
A high-level overview of the project structure and purpose extracted by GitIngest.Directory tree
The complete file structure showing organization and key files:Source code content
Full content of relevant source files, allowing the AI to understand implementation details.Custom instructions
The prompt includes specific requirements:- Generate authentic content without placeholders
- Include a DeepWiki badge for AI-powered documentation
- Focus on clarity and professionalism
- Output raw markdown without code blocks
The prompt explicitly instructs: “Do not generate any placeholder text or placeholder images in the readme file.”
Token limits and validation
GitRead enforces strict limits to ensure quality and prevent failures:Input token limit
Token counting
The system uses word-based token estimation:Repository processing
URL validation
Only valid GitHub URLs are accepted:https://github.com/username/repository
GitIngest integration
GitRead uses a Python microservice to process repositories:- content - Full text of repository files
- summary - Project overview
- tree - Directory structure
- estimated_tokens - Token count for the content
- warnings - Any processing issues
- limits - Size and complexity constraints
Response processing
After generation, the markdown content is cleaned:Rate limiting and queuing
GitRead implements a request queue to handle high traffic:Queue behavior
- Queue position tracking - Users see their position if queue is not empty
- Overload protection - Returns 429 status if queue exceeds 20 requests
- Sequential processing - Requests are processed one at a time
If the server is busy, you’ll receive a queue position and your request will be processed automatically.
Error handling
The API provides detailed error messages for common issues:| Error | Status | Description |
|---|---|---|
| Invalid URL | 400 | GitHub URL format is incorrect |
| Token limit exceeded | 400 | Repository is too large |
| Insufficient credits | 402 | User needs to purchase credits |
| Rate limit | 429 | OpenRouter API limit reached |
| Server busy | 429 | Queue is full, try again later |
Rate limit errors
Performance
Generation time varies based on repository size:- Small repos (< 50 files) - 10-30 seconds
- Medium repos (50-200 files) - 30-90 seconds
- Large repos (200+ files) - 1-3 minutes
The system shows a loading indicator with your queue position during generation.