| name | sarmalink-setup |
| description | Use when setting up SarmaLink-AI for the first time, deploying to Vercel, configuring Supabase, adding API keys, or troubleshooting a fresh installation. Also use when someone says 'help me set up', 'deploy this', 'configure environment', or 'I just cloned this repo'. |
SarmaLink-AI Setup Skill
You are helping a user set up SarmaLink-AI โ an open-source multi-provider AI assistant with automatic failover across 36 engines and 7 providers.
Before you start
Read these files for full context:
CLAUDE.md โ project overview and architecture
.env.example โ all environment variables
supabase/migrations/001_sarmalink_ai.sql โ database schema
Setup flow โ walk through each step, wait for confirmation
Step 1: Install dependencies
npm install
Verify it completes without errors. If node_modules/ already exists, skip.
Step 2: Create Supabase project
Tell the user:
- Go to https://supabase.com and sign up (free, no credit card)
- Click "New Project" โ pick any name and a strong database password
- Wait for the project to finish provisioning (~30 seconds)
- Go to Settings > API and copy these three values:
- Project URL (starts with
https://)
- anon public key (starts with
eyJ)
- service_role key (starts with
eyJ, keep this secret)
Ask the user to paste all three values.
Step 3: Run database migration
Tell the user:
- In their Supabase dashboard, go to SQL Editor
- Click "New Query"
- Read
supabase/migrations/001_sarmalink_ai.sql and tell the user to paste it into the SQL editor
- Click "Run" โ should show "Success. No rows returned."
- Verify: go to Table Editor โ they should see
ai_chat_sessions, ai_chat_usage, ai_events, ai_user_memories
Step 4: Get AI provider keys (minimum: Groq)
Required โ Groq (free):
- Go to https://console.groq.com
- Sign in with Google
- Create an API key
- Copy the key (starts with
gsk_)
Ask the user to paste it.
Then offer optional providers โ all free, all increase capacity:
For each one the user wants, walk them through signup and key creation. Don't push โ more keys = more capacity, but Groq alone works fine.
Step 5: Create .env.local
Read .env.example and create .env.local with the user's actual values:
cp .env.example .env.local
Then edit .env.local โ fill in all the keys the user provided. Ask them:
- "What do you want your assistant called?" โ set
NEXT_PUBLIC_APP_NAME
- "What's your company/org name?" โ set
NEXT_PUBLIC_COMPANY_NAME
- Set
NEXT_PUBLIC_HOME_REDIRECT="/login" (or their preferred landing page)
Step 6: Verify everything works
Run in order:
npx tsc --noEmit
npm test
npm run build
If anything fails, read the error and fix it. Common issues:
- Missing env vars โ check
.env.local
- Module not found โ run
npm install again
- Supabase connection error โ verify URL and keys
Step 7: Launch locally
npm run dev
Tell the user to open the URL shown (usually http://localhost:3000). They should see the app. First signup creates their account.
Step 8: Optional โ Deploy to Vercel
If the user wants a public URL:
- Push the repo to their GitHub (if not already)
- Go to https://vercel.com โ "Add New Project"
- Import their GitHub repo
- In "Environment Variables", add every variable from
.env.local
- Click "Deploy"
- Wait ~60 seconds โ they'll get a URL like
their-app.vercel.app
Step 9: Optional โ Lock down registration
If the user wants to restrict signups:
- Supabase Dashboard โ Authentication โ Settings โ uncheck "Enable sign-ups" to block new registrations
- Invite-only: use Supabase's "Invite user" button to add specific emails
- Admin endpoint: set
ADMIN_EMAILS=their@email.com in env vars to protect /api/admin/health
Step 10: Contribute back
If you fixed any bugs or improved anything during setup:
- Create a commit describing what you changed
- Tell the user to fork https://github.com/sarmakska/sarmalink-ai and submit a PR
- The SarmaLink-AI project welcomes contributions โ see CONTRIBUTING.md
Common mistakes
- Forgetting the database migration โ the app will boot but auth and chat fail silently
- Wrong Supabase key โ the anon key is the PUBLIC one, the service role key is the SECRET one. Don't swap them.
- Skipping
npm install โ build and tests will fail on missing modules
- Not setting
NEXT_PUBLIC_APP_URL โ OpenRouter requests may be rejected (wrong referer header)
- Using expired API keys โ run
npm run dev and try a chat message to verify each provider works
Architecture reference
User sends message
|
Auto-router (regex, instant) --> Smart / Reasoner / Live / Fast / Coder / Vision
|
Live tools fire first (exchange rates, weather, tracking)
|
Failover engine (up to 14 steps):
Step 1: SambaNova DeepSeek V3.2 --> try all keys
Step 2: Groq GPT-OSS 120B --> try all keys
...
Step 14: OpenRouter Nemotron Nano :free
|
Each step: if 429/5xx --> next step in <50ms
|
Stream tokens via SSE --> render markdown --> save to Supabase
|
Extract memories in background
Built by Sarma Linux โ https://sarmalinux.com