Claude as an AI provider, and AI that reads a running service's logs.
Upgrade notes
- No migration. The AI configuration gains an optional
provider. A configuration saved before has none and keeps working as an OpenAI-compatible endpoint, unchanged. GET /v1/ai/configreportsprovider.PUT /v1/ai/configwithoutprovidermeansopenaiand still needsbaseUrl.
Added
- Claude as a provider.
provider: 'anthropic'onPUT /v1/ai/config(Settings → AI assistant, which now has a provider selector).- It calls the Anthropic Messages API (
POST <base>/v1/messages,x-api-key,anthropic-version: 2023-06-01). baseUrlis optional and defaults tohttps://api.anthropic.com.- Every AI feature uses it: failed-deploy diagnosis, manifest suggestions and the log analysis below. The provider code is shared (
lib/aiProvider.ts), so the upstream body is still never relayed in an error.
- It calls the Anthropic Messages API (
- Runtime-log analysis.
POST /v1/ai/services/:id/logs/analyzewith{ tail? }(20–5000, default 300).- It reads the service's newest runtime log lines through the same reader as
GET /v1/services/:id/logs(PM2, Swarm, nodes, the panel host), and applies the diagnosis sanitizer and its 16 KB cap. - It answers the model's analysis (health, problems with the log lines quoted, next steps), the model, and how many lines were sent.
- Gates:
memberon the service, protected lanes, the AI spend rule, 10 calls a minute. It is audited asai.analyze_logs. - Web: an Analyze button on the runtime logs card when a provider is configured. CLI:
ninedeploy logs analyze <service> [--tail] [--json]. SDK:ai.analyzeLogs.
- It reads the service's newest runtime log lines through the same reader as
- Docs: docs/AI.md describes the providers, who may use them, what leaves the panel, and each feature.