Skip to content

flavienbwk/repochat-action

Repository files navigation

Repochat Action

Deployment CI GitHub release License: MIT

Warning

This project is in early development and may contain bugs. Use with caution in production environments.

Chat with your repo in under 2 minutes using GitHub Actions on supported Cloud providers.

Features:

  • ✨ A nice web UI
  • :octocat: Available as a GitHub Action
  • 🔄 Sateless ingestion via API
  • 💾 Optional state persisted to PostgreSQL or ChromaDB
  • 🔐 Optional password on web UI

RepoChat interface example

Requirements

Usage for GitHub Actions

Easily add RepoChat to your project using GitHub Actions:

name: "Deploy Repochat for this repo"

on:
  push:
    branches:
    - main

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - uses: flavienbwk/repochat-action@v0
      name: 'Deploy Repochat'
      id: deploy_repochat
      with:
        # All parameters not explicitly marked as "optional" are required
        dirs_to_scan: "."  # comma-separated glob dirs to analyze
        interface_password: ${{ secrets.INTERFACE_PASSWORD }}  # optional
        openai_api_key: ${{ secrets.OPENAI_API_KEY }}
        openai_model_type_inference: "gpt-4o-mini"
        openai_model_type_embedding : "text-embedding-3-small"
        provider_name: 'scaleway'
        provider_key_id: ${{ secrets.PROVIDER_KEY_ID }}
        provider_key_secret: ${{ secrets.PROVIDER_KEY_SECRET }}
        provider_project_id: ${{ secrets.PROVIDER_PROJECT_ID }}
        provider_default_region: 'fr-par'
        provider_default_zone: 'fr-par-2'

    - name: Get repochat domain
      run: echo "DOMAIN=${{ steps.deploy_repochat.outputs.domain }}" >> $GITHUB_OUTPUT
      id: repochat_domain
Name Required Secret Description
dirs_to_scan Yes No Comma-separated glob directories to analyze
openai_api_key Yes Yes OpenAI API key for authentication
openai_model_type_inference Yes No OpenAI model type for inference (e.g., "gpt-4o-mini")
openai_model_type_embedding Yes No OpenAI model type for embedding (e.g., "text-embedding-3-small")
provider_name Yes No Name of the cloud provider (e.g., 'scaleway')
provider_key_id Yes Yes Cloud provider API key ID
provider_key_secret Yes Yes Cloud provider API key secret
provider_project_id Yes Yes Cloud provider project ID
provider_default_region Yes No Default region for the cloud provider (e.g., 'fr-par')
provider_default_zone Yes No Default zone for the cloud provider (e.g., 'fr-par-2')
interface_password No Yes Optional password for the interface
pg_connection_string No Yes Enables storage to external PG DB (format: 'postgresql://username:password@hostname:port/database_name')
cpu_limit No No Default to 1000 (1 vCPU). Capabilities depend on the Cloud provider.
memory_limit No No Default to 1024. Capabilities depend on the Cloud provider.
min_scale No No Default to 1. Must be left to 1 if not using the PG connection.
max_scale No No Default to 1. Must be left to 1 if not using the PG connection.

Get a practical implementation example with .github/workflows/push-deploy.yml.

You can restrict your OpenAI API key permissions to:

  • Models: Read
  • Model capabilities: Write

Supported Cloud providers

  • Scaleway
    • Refer to Scaleway's documentation to generate API keys.

    • Additional required parameters:

      provider_name: 'scaleway'
      provider_key_id: ${{ secrets.PROVIDER_KEY_ID }}
      provider_key_secret: ${{ secrets.PROVIDER_KEY_SECRET }}
      provider_project_id: ${{ secrets.PROVIDER_PROJECT_ID }}
      provider_default_region: 'fr-par'  # example
      provider_default_zone: 'fr-par-2'  # example
    • Policies: ContainersFullAccess, ServerlessJobsFullAccess, FunctionsFullAccess

Other deployments

Deploy with Docker

👉 Deploy locally as a stateless API...
  1. Copy and update env variables

    cp .env.example .env
  2. Run the Docker container

    docker compose up --build -d
  3. Inject data taking example on the Python or JS scripts

  4. Access the app at http://localhost:3001

Development

👉 Run RepoChat for development...
  1. Clone this repo

    [email protected]:flavienbwk/repochat-action.git
  2. Copy and update env variables

    cp .env.example .env
  3. Run the local stack

    make dev
  4. Access the app at http://127.0.0.1:3000

Release Action

  1. Increase repochat's version in ./package.json

  2. Run build and commit latest edits:

    npm run build
    # git add && git commit && git push...
  3. Merge on main

    This will create a release based on package.json and push the :latest Docker image.

Why not use Vercel ?

Vercel is very limited when it comes to deploying everything but JS. First, ChromaDB (and any sqlite-based library) is not supported in Vercel. Then, this project uses a FastAPI Python API that requires more storage than Vercel's 250MB bundle limit.