Skip to content

Latest commit

Β 

History

History
139 lines (97 loc) Β· 3.6 KB

File metadata and controls

139 lines (97 loc) Β· 3.6 KB

Contributing to GPT

Thank you for your interest in contributing! This document outlines how to contribute effectively to this project.


πŸš€ Getting Started

  1. Fork the repository on GitHub.
  2. Clone your fork locally:
    git clone https://github.com/YOUR_USERNAME/GPT.git
    cd GPT
  3. Create a branch for your changes:
    git checkout -b feature/your-feature-name
    or
    git checkout -b fix/your-bug-fix

πŸ”§ Development Setup

Backend

cd backend
python -m venv venv
source venv/bin/activate  # or venv\Scripts\activate on Windows
pip install torch fastapi uvicorn numpy pydantic starlette

Frontend

npm install

πŸ“ Code Style & Linting

Python (Backend)

  • Follow PEP 8 conventions.
  • Use type annotations on all function signatures.
  • Prefer immutable data structures (use dataclass(frozen=True), NamedTuple).
  • Format with black, sort imports with isort, lint with ruff.
  • Use the logging module instead of print() statements.

TypeScript / React (Frontend)

  • Follow the existing TypeScript strict mode configuration.
  • Use import type for type-only imports (verbatimModuleSyntax is enabled).
  • Remove unused variables β€” noUnusedLocals and noUnusedParameters are enforced.
  • Lint with oxlint (npm run lint).
  • Use functional components with hooks; avoid class components.

πŸ› Bug Reports

When reporting a bug, please include:

  1. Summary: A clear, concise description of the problem.
  2. Steps to Reproduce: Numbered steps that reliably trigger the bug.
  3. Expected Behavior: What you expected to happen.
  4. Actual Behavior: What actually happened (include error messages, logs, screenshots).
  5. Environment: OS, Python/Node version, GPU (if applicable).
  6. Severity: Low / Medium / High / Critical.

Use the Bug Report issue template when opening a new issue.


πŸ’‘ Feature Requests

When proposing a feature, please include:

  1. Problem Statement: What problem does this solve?
  2. Proposed Solution: Your idea for addressing it.
  3. Alternatives Considered: Other approaches you evaluated.
  4. Scope: What is in scope and out of scope.
  5. Risks: Potential downsides or breaking changes.

Use the Feature Request issue template when opening a new issue.


πŸ§ͺ Testing

  • Add tests for new features and bug fixes.
  • Run the existing test suite before submitting a pull request.
  • For backend changes, verify the /generate endpoint still works:
    curl "http://localhost:8010/generate?tokens=50"
  • For frontend changes, run npm run build to verify the build succeeds.

πŸ“š Documentation Updates

  • Update the relevant documentation when changing public APIs, configuration, or architecture.
  • Update CLAUDE.md if the data flow or module structure changes.
  • Update README.md if dependencies or setup steps change.

πŸ”„ Pull Request Process

  1. Ensure your branch is up to date with main:
    git fetch origin
    git rebase origin/main
  2. Run all linters and tests.
  3. Fill out the pull request template completely.
  4. Link any related issues (e.g., Fixes #123).
  5. Request a review from a maintainer.
  6. Address review feedback promptly.

πŸ“œ Code of Conduct

By participating in this project, you agree to abide by our Code of Conduct.


πŸ“¬ Questions?

Open a GitHub Discussion or reach out by opening an issue.

Happy contributing! πŸŽ‰