HeyPuter/puter · critical · HttpError

internal_error

internal_error

Error message

No provider found for model ${model.id}

What it means

#resolveModel found the model id in #modelIdMap (so the model is declared), but the model's provider field doesn't match any key in #providers. Throws HTTP 500 internal_error — this is a server-side configuration inconsistency, not a caller mistake. A model entry points at a provider that was never instantiated/registered.

Source

Thrown at src/backend/drivers/ai-image/ImageGenerationDriver.ts:178

        }
        if (!modelId && intendedProvider) {
            modelId = this.#providers[intendedProvider]?.getDefaultModel();
        }
        if (!modelId)
            throw new HttpError(400, 'Missing `model`', {
                legacyCode: 'bad_request',
            });

        const model = this.#resolveModel(modelId, intendedProvider);
        if (!model) {
            throw new HttpError(400, `Model not found: ${args.model}`, {
                legacyCode: 'bad_request',
            });
        }

        const provider = this.#providers[model.provider!];
        if (!provider) {
            throw new HttpError(
                500,
                `No provider found for model ${model.id}`,
                { legacyCode: 'internal_error' },
            );
        }

        // `width`/`height` or `aspect_ratio` -> `ratio: {w,h}`
        this.#normalizeRatio(args);

        // Audit log for abuse / billing. Fired before the upstream call
        // so a failed generate still shows up in the log (prompt_block
        // uses this to track user-by-user image prompts).
        const completionId = crypto.randomUUID();
        this.clients.event.emit(
            'ai.log.image',
            {
                actor,
                completionId,

View on GitHub (pinned to 908ec23eda)

Solutions

  1. Check boot logs for the provider failing to register (missing API key, bad config).
  2. Ensure the provider named by model.provider is actually enabled and instantiated.
  3. Reconcile config: every model's provider must have a registered provider entry.

Example fix

// before — config lists a model for 'stability' but provider not registered
// after — enable/register the matching provider, or remove the orphan model entry
Defensive patterns

Strategy: validation

Validate before calling

// On boot, assert every declared model's provider is actually registered.
for (const m of declaredModels) {
  if (!providers[m.provider]) {
    throw new Error(`config inconsistency: model ${m.id} -> missing provider ${m.provider}`);
  }
}

Prevention

When it happens

Trigger: Config declares a model under a provider, but that provider failed to register or was misnamed, so model.provider has no matching #providers entry.

Common situations: Provider registration failed silently on boot (bad credentials/config), a provider id typo between the model map and the providers map, or partial config where a model is listed but its provider isn't enabled.

Related errors


AI-assisted analysis of HeyPuter/puter@908ec23eda (2026-08-12). Data as JSON: /api/errors/6c3573dbe96ea514. Report an issue: GitHub.