๐๏ธ Training Systemsยท 6 min read
Adapter Registry & Versioning
Managing adapter lifecycle, A/B testing different adapters in production, and infrastructure for adapter management at scale.
adapterregistryversioninga-b-testinglifecycleproduction
With hundreds of adapters in production, you need infrastructure to manage their lifecycle โ training, evaluation, deployment, and retirement.
1. The Adapter Lifecycle
Train โ Evaluate โ Register โ Deploy โ Monitor โ Update/Retire
| Phase | Artifacts | Actions |
|---|---|---|
| Train | Adapter weights, config, training logs | LoRA/QLoRA training |
| Evaluate | Benchmark scores, human eval results | Automated + manual quality gates |
| Register | Metadata (base model, rank, training data hash) | Version and tag in registry |
| Deploy | Adapter loaded in serving system | A/B test with traffic splitting |
| Monitor | Quality metrics, latency, user feedback | Automated regression detection |
| Update | New adapter version | Retrain on updated data |
2. Registry Design
# Example adapter registry entry
{
"adapter_id": "medical-v3",
"base_model": "llama-3.1-70b",
"base_model_hash": "abc123...", # ensure base model compatibility
"lora_rank": 16,
"lora_alpha": 32,
"target_modules": ["q_proj", "k_proj", "v_proj", "o_proj",
"gate_proj", "up_proj", "down_proj"],
"training_data_hash": "def456...", # reproducibility
"training_steps": 5000,
"eval_scores": {
"medqa": 0.89,
"mmlu_medical": 0.91,
"general_mmlu": 0.82, # monitor for forgetting
},
"status": "canary", # canary โ production โ deprecated
"created_at": "2024-10-20T12:00:00Z",
}
Version Compatibility
Critical: An adapter trained on Llama-3.1-70b cannot be used with Llama-3.1-70b-Instruct (different weights). The registry must track exact base model hashes.
3. A/B Testing Adapters
# Traffic splitting in inference router
def route_request(request):
customer = request.customer_id
adapter_config = get_adapter_config(customer)
if adapter_config.ab_test_active:
# 90% to current adapter, 10% to new candidate
if hash(request.id) % 100 < 10:
return adapter_config.candidate_adapter
else:
return adapter_config.current_adapter
return adapter_config.current_adapter
Metrics to compare: quality scores, user satisfaction, latency, cost per request.
For the serving infrastructure that hosts these adapters, see Multi-Adapter Serving.
Self-Check
- Design an adapter registry schema for a production system
- Explain why base model hash tracking is critical
- Set up A/B testing between adapter versions
- Define quality gates for promoting an adapter from canary to production