A chatbot that simulates Peter Roberts (YC's immigration attorney) answering immigration questions, based on his past Hacker News AMAs.
- Chat interface for asking immigration questions
- Uses GPT-4o mini by default, with option to use a fine-tuned model
- Filters out non-immigration related questions
- Provides informative answers based on Peter Roberts' style and expertise
- Trained on historical HN AMA responses when using the fine-tuned model
- Node.js (>= 18.x recommended)
- npm
- OpenAI API key
-
Clone the repository
git clone https://github.com/yourusername/proberts.git cd proberts
-
Install dependencies
npm install
-
Create a
.env.local
file in the root directory with your OpenAI API keyOPENAI_API_KEY=your_openai_api_key_here # Uses gpt-4o-mini by default if no fine-tuned model is specified # After fine-tuning, uncomment and add your fine-tuned model ID: # OPENAI_MODEL_ID=your_fine_tuned_model_id
-
Run the scraping script to collect Peter Roberts' HN AMA data
node scripts/scrape-amas.js
-
Fine-tune the model with the collected data
node scripts/fine-tune.js
Note: This process uses the specific GPT-4o mini version (gpt-4o-mini-2024-07-18) for fine-tuning
-
Check the status of your fine-tuning job
node scripts/fine-tune.js --status JOB_ID
-
Once fine-tuning is complete, add the model ID to your
.env.local
fileOPENAI_MODEL_ID=your_fine_tuned_model_id
Run the development server:
npm run dev
Open http://localhost:3000 in your browser to see the application.
This application is designed to be deployed on Vercel.
- Push your code to a GitHub repository
- Connect your repository to Vercel
- Add your environment variables (OPENAI_API_KEY and OPENAI_MODEL_ID) in the Vercel dashboard
- Deploy!
This application is for informational purposes only and does not provide legal advice. The responses are based on Peter Roberts' public HN AMA answers but may not be suitable for your specific situation. Always consult with a qualified immigration attorney for legal advice.
This project has been "vibe coded" with Claude Code. Zero lines of code have been written by a human. Claude Code helped:
- Generate the chat interface components
- Create the fine-tuning data processing scripts
- Debug TypeScript errors
- Build the API endpoint logic
- Implement the prompt engineering for accurate Peter Roberts-style responses
- Structure the data collection pipeline
MIT