Thank you for your interest in contributing to Batch-GPT! This document provides guidelines and best practices for contributions.
- Fork and clone the repository
- Install prerequisites:
- Go 1.23.0 or later
- Docker and Docker Compose
- Python 3.x (for test client)
- Set up MongoDB:
cd local/mongo docker-compose up -d
- Set required environment variables as described in README.md
/server
: Main server code/db
: Database interactions/handlers
: HTTP request handlers/logger
: Custom logging setup/models
: Data models/services
: Business logic and OpenAI interactions/batch
: Batch processing logic/cache
: Caching logic/client
: OpenAI client wrapper/config
: Configuration management/utils
: Common utilities
/cmd
: Command-line tools/monitor
: Terminal-based monitoring tool/ui
: UI components and styling
/local/mongo
: Local MongoDB setup/test-python-client
: Test client
-
Choose the appropriate package:
/server/handlers
for new API endpoints/server/db
for database interactions/server/services/*
for business logic/cmd/monitor/ui
for monitoring UI components
-
Implementation:
- Add types/interfaces in
types.go
if needed - Implement core functionality
- Update services/orchestrators as needed
- Add environment variables to config package
- Add types/interfaces in
-
Integration:
- Wire new handlers in
server/main.go
- Update UI model in
ui/model.go
for UI changes - Create necessary database indexes
- Wire new handlers in
-
Testing:
- Test in all serving modes (sync/async/cache)
- Update test Python client for API changes
- Follow Go standard formatting (
go fmt
) - Use meaningful variable and function names
- Add comments for complex logic
- Keep functions focused and concise
- Write idiomatic Go code
- Create a feature/fix branch (
feature/description
orfix/description
) - Make focused, incremental changes
- Test changes in all serving modes
- Update documentation as needed
- Submit PR with clear description of changes
- Respond to review comments
When creating an issue, include:
- Clear description of the problem
- Steps to reproduce
- Expected vs actual behavior
- Environment details (OS, Go version, etc.)
- Relevant logs or error messages
Feel free to open an issue for any questions about contributing.