A LangGraph-based coding agent with sandbox code execution, powered by Modal.
git clone https://github.com/your-username/model-eval-agent.git
cd model-eval-agentpip install modalmodal token newThis opens a browser for authentication. After login, your token is saved locally.
Go to Modal Secrets Dashboard and create the following secrets:
| Secret Name | Key | Value |
|---|---|---|
openai-secret |
OPENAI_API_KEY |
Your OpenAI API key |
google-api-secret |
GOOGLE_API_KEY |
Your Google AI API key |
How to create a secret:
- Click "Create new secret"
- Choose "Custom" type
- Enter the secret name (e.g.,
openai-secret) - Add environment variable: key =
OPENAI_API_KEY, value = your key - Click "Create"
cd backend
pip install uv # if not installed
uv syncmodal deploy -m backend.appAfter deployment, you'll see output like:
✓ Created web endpoint https://your-username--model-eval-app-web.modal.run
This is your Modal API URL! 🎉
Create frontend/.env.local:
NEXT_PUBLIC_API_URL=https://your-username--model-eval-app-web.modal.runcd frontend
npm install
npm run devVisit http://localhost:3000 to use the agent.
| Endpoint | Method | Description |
|---|---|---|
/ask/stream |
POST | Stream agent responses |
/health |
GET | Health check |
/files |
GET | List available files |
modal run -m backend.app --question "Hello"modal run -m backend.app --debug --question "Test"┌─────────────────────────────────────────────────┐
│ Frontend │
│ (Next.js + React) │
└─────────────────────┬───────────────────────────┘
│ HTTP/SSE
▼
┌─────────────────────────────────────────────────┐
│ Modal App │
│ ┌───────────────────────────────────────────┐ │
│ │ LangGraph Agent │ │
│ │ [generate] → [execute_tools] → [finish] │ │
│ └───────────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌───────────────────────────────────────────┐ │
│ │ Modal Sandbox │ │
│ │ (Isolated Python Execution) │ │
│ └───────────────────────────────────────────┘ │
└─────────────────────────────────────────────────┘
Run modal token new to authenticate.
Create secrets at https://modal.com/secrets with exact names: openai-secret, google-api-secret.
Check Modal logs: modal app logs model-eval-app
Verify NEXT_PUBLIC_API_URL in .env.local matches your deployed Modal URL.