sentinel-scam-honeypo / HF_DEPLOYMENT_CHECKLIST.md
avinash-rai's picture
Deployment Ready: Fixed scam detection low confidence, added production audit report, optimized throttles
1838600
|
raw
history blame
2.97 kB

πŸš€ HF Deployment Pre-Flight Checklist

Target: Hugging Face Spaces + GUVI Hackathon


βœ… Required HF Secrets

Set these in HF Spaces β†’ Settings β†’ Secrets:

Secret Name Required Description
GROQ_API_KEY βœ… YES Groq API key for LLM calls
GUVI_API_KEY βœ… YES GUVI hackathon auth key

Optional (defaults work):

  • ENV=production (optional, defaults to production behavior)

βœ… Pre-Deploy Verification Commands

Run these locally before pushing to HF:

# 1. All behavioral tests pass
py -m pytest scripts/fast_behavior_tests.py -v

# 2. Cache optimization tests pass  
py -m pytest scripts/test_prompt_caching.py -v -s -k "not Live"

# 3. Main app imports cleanly
py -c "from app.main import app; print('βœ… OK')"

# 4. Quick smoke test (start server)
py -m uvicorn app.main:app --port 8000 --host 127.0.0.1
# Then test: curl http://localhost:8000/health

βœ… Model Mapping (Cache-Optimized)

Agent Model Cache Support
Persona Replies llama-3.1-8b-instant ❌ No
Intelligence Extraction openai/gpt-oss-20b βœ… Yes
Safety Guard openai/gpt-oss-safeguard-20b βœ… Yes
Smart Reasoning moonshotai/kimi-k2-instruct-0905 βœ… Yes

Note: Fast chat uses uncached model for speed. Heavy tasks use cached models for cost savings.


βœ… Config Sanity Checklist

Check Status
DEBUG = False in config.py βœ…
Mock callback URL commented out βœ…
No hardcoded API keys βœ…
No blocking time.sleep() βœ…
All retries capped at 2-5 βœ…

βœ… GUVI Callback Readiness

Requirement Status
URL: https://hackathon.guvi.in/api/updateHoneyPotFinalResult βœ…
Auth: x-api-key header βœ…
Retry: 5x exponential backoff βœ…
Dedup: sys_callback_sent flag βœ…
Trigger: scamDetected=True AND should_finalize=True βœ…

βœ… Budget Limits (Hardcoded)

Limit Value Enforced
Max LLM calls per turn 4 βœ…
Max LLM calls per session 30 βœ…
Max cascade retries 2 βœ…

πŸ§ͺ 1-Command HF Sanity Test

After deploying to HF, run this:

curl -X POST "https://YOUR-SPACE.hf.space/api/v1/guvi/challenge" \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_GUVI_API_KEY" \
  -d '{
    "sessionId": "test-123",
    "message": {"text": "Hello, your bank account is blocked", "sender": "scammer"}
  }'

Expected Response:

{
  "status": "success",
  "reply": "..."
}

πŸ† Final Deployment Commands

# 1. Commit all changes
git add .
git commit -m "Production-ready for GUVI + HF"

# 2. Push to HF
git push hf main

Last Verified: 2026-02-03
Score: 53/53 (100%) Production Ready β€” All Critical Fixes Applied