| name | mistral-prod-checklist |
| description | Execute Mistral AI production deployment checklist and rollback procedures.
Use when deploying Mistral AI integrations to production, preparing for launch,
or implementing go-live procedures.
Trigger with phrases like "mistral production", "deploy mistral",
"mistral go-live", "mistral launch checklist".
|
| allowed-tools | Read, Bash(kubectl:*), Bash(curl:*), Grep |
| version | 1.0.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
Mistral AI Production Checklist
Overview
Complete checklist for deploying Mistral AI integrations to production.
Prerequisites
- Staging environment tested and verified
- Production API keys available
- Deployment pipeline configured
- Monitoring and alerting ready
Instructions
Step 1: Pre-Deployment Configuration
Secrets & Configuration
Verify API Key:
curl -H "Authorization: Bearer ${MISTRAL_API_KEY_PROD}" \
https://api.mistral.ai/v1/models | jq '.data[].id'
Step 2: Code Quality Verification
Code Review
Run Verification:
npm test
npm run typecheck
grep -r "sk-" src/ --include="*.ts" --include="*.js"
npm run lint
Step 3: Infrastructure Setup
Health Checks
app.get('/health', async (req, res) => {
const mistralHealth = await checkMistralHealth();
res.status(mistralHealth.healthy ? 200 : 503).json({
status: mistralHealth.healthy ? 'healthy' : 'degraded',
services: {
mistral: mistralHealth,
},
timestamp: new Date().toISOString(),
});
});
async function checkMistralHealth() {
const start = Date.now();
try {
await client.models.list();
return { healthy: true, latencyMs: Date.now() - start };
} catch (error) {
return { healthy: false, latencyMs: Date.now() - start, error: 'API unreachable' };
}
}
Monitoring & Alerting
Step 4: Resilience Patterns
Circuit Breaker
class MistralCircuitBreaker {
private failures = 0;
private lastFailure?: Date;
private isOpen = false;
private readonly failureThreshold = 5;
private readonly resetTimeout = 60000;
async call<T>(fn: () => Promise<T>, fallback?: () => T): Promise<T> {
if (this.isOpen) {
if (Date.now() - (this.lastFailure?.getTime() || 0) > this.resetTimeout) {
this.isOpen = false;
this.failures = 0;
} else {
if (fallback) return fallback();
throw new Error('Mistral service temporarily unavailable');
}
}
try {
result = ();
. = ;
result;
} (: ) {
.++;
. = ();
(. >= .) {
. = ;
.();
}
(fallback && .) ();
error;
}
}
}
Step 5: Documentation Requirements
Step 6: Deploy with Gradual Rollout
echo "=== Pre-flight Checks ==="
echo -n "Mistral API: "
curl -s -o /dev/null -w "%{http_code}" \
-H "Authorization: Bearer ${MISTRAL_API_KEY_PROD}" \
https://api.mistral.ai/v1/models
echo ""
echo -n "Staging health: "
curl -sf https://staging.yourapp.com/health | jq -r '.status'
npm test
echo "=== Starting Gradual Rollout ==="
kubectl set image deployment/mistral-app app=image:new --record
kubectl rollout pause deployment/mistral-app
echo "Monitoring canary for 10 minutes..."
sleep 600
kubectl logs -l app=mistral-app --since=10m | grep -c "error" || echo "0 errors"
kubectl rollout resume deployment/mistral-app
kubectl rollout pause deployment/mistral-app
sleep 300
kubectl rollout resume deployment/mistral-app
kubectl rollout status deployment/mistral-app
Step 7: Post-Deployment Verification
echo "=== Post-Deployment Verification ==="
curl -sf https://yourapp.com/health | jq
curl -X POST https://yourapp.com/api/chat \
-H "Content-Type: application/json" \
-d '{"messages": [{"role": "user", "content": "Hello"}]}' | jq
kubectl logs -l app=mistral-app --since=5m | grep -i error
Output
- Deployed Mistral AI integration
- Health checks passing
- Monitoring active
- Rollback procedure documented
Alert Configuration
| Alert | Condition | Severity |
|---|
| API Down | 5xx errors > 10/min | P1 - Critical |
| High Latency | p99 > 5000ms for 5min | P2 - High |
| Rate Limited | 429 errors > 5/min | P2 - High |
| Auth Failures | 401 errors > 0 | P1 - Critical |
| Circuit Open | Circuit breaker triggered | P2 - High |
Rollback Procedure
echo "=== Emergency Rollback ==="
kubectl rollout undo deployment/mistral-app
kubectl rollout status deployment/mistral-app
curl -sf https://yourapp.com/health | jq
Resources
Next Steps
For version upgrades, see mistral-upgrade-migration.