# Deploying V6 Production Model ## Quick Deploy (zero code changes) The V6 model uses the **exact same 37-feature schema** as your existing `app/recommend/reranker.py`. To deploy: ### Option 1: Replace the model file ```bash # In your ResearchIT Space repo: cp production_model/reranker_v6_production.txt models/reranker-phase6/production_model/reranker_v1.txt ``` The reranker code searches for `reranker_v1.txt` — replacing it with V6 makes it active immediately. ### Option 2: Add as a new path (safer) In `app/recommend/reranker.py`, add V6 to the search paths (it's checked first): ```python _MODEL_SEARCH_PATHS = [ os.environ.get("RERANKER_MODEL_PATH", ""), "models/reranker-phase6/production_model/reranker_v6_production.txt", # ← ADD THIS "models/reranker-phase6/production_model/reranker_v1.txt", "production_model/reranker_v1.txt", ... ] ``` ### Option 3: Use environment variable ```bash export RERANKER_MODEL_PATH="models/reranker-phase6/production_model/reranker_v6_production.txt" ``` ## What Changed (V1 → V6) | Aspect | V1 | V6 | |--------|-----|-----| | Feature schema | 37 features | 37 features (identical) | | Training labels | cited=2, co-cited=1, not=0 | 5-tier expert authority | | Hard Neg AUC | ~0.63 | **0.758** (+20.7%) | | Trees | 141 | 32 (faster inference) | | Model size | 948 KB | 219 KB (77% smaller) | | Latency | 0.37ms/100 candidates | ~0.2ms/100 candidates (fewer trees) | ## What This Means for Users V6 will: - Rank papers from the right field higher (category matching learned) - Give recency a proper weight (not just citation count) - Better balance between highly-cited classics and newer relevant work - Suppress papers that experts consistently exclude from reading lists ## Verification After deploying, check the health endpoint: ``` GET /healthz/reranker ``` Should return: ```json {"model_loaded": true, "num_trees": 32, "num_features": 37} ``` ## Rollback If anything goes wrong, revert to V1: ```bash export RERANKER_MODEL_PATH="models/reranker-phase6/production_model/reranker_v1.txt" ```