This project is a vendor-agnostic implementation of SR&ED GPT, featuring:
- Frontend: React + Vite (deployed on Vercel)
- Backend: Supabase
- AI: Hybrid 3-Tier Architecture (DeepSeek-R1-Distill-Qwen-1.5B)
- Tier 1: Hugging Face Serverless API (Primary)
- Tier 2: Self-Hosted Docker on HF Spaces (Backup)
- Tier 3: Groq API (Fallback)
- Node.js & npm
- Supabase CLI
- Docker (optional, for local testing)
-
Clone the repository:
git clone https://github.com/TomCruiseTorpedo/rambo2 cd rambo2 -
Install dependencies:
npm install
-
Set up environment variables: Create a
.envfile with:VITE_SUPABASE_URL=your_supabase_url VITE_SUPABASE_PUBLISHABLE_KEY=your_supabase_key -
Start the development server:
npm run dev
Connect this repository to Vercel and deploy. Ensure the build command is npm run build and output directory is dist.
This project uses a Tier 2 Backup hosted on Hugging Face Spaces.
- Create a new Space (SDK: Docker, Hardware: CPU Basic).
- Use the helper script to deploy the Dockerfile:
Example:
./scripts/deploy_to_hf.sh <your_hf_username> <space_name>
./scripts/deploy_to_hf.sh myuser tomcruisemissile-rambo2
Deploy the Edge Functions:
npx supabase functions deploy process-sred --no-verify-jwt
npx supabase functions deploy fill-pdf-t661 --no-verify-jwtEnsure you have set the following secrets in Supabase:
LLM_API_URL(Your HF Space URL)LLM_API_KEY(Your HF Token)GROQ_API_KEY(Optional, for Tier 3 fallback)