Skip to content

Add Per-provider model configuration for failover #182

@lowbits

Description

@lowbits

Problem

When using multiple providers as failover, there's no way to specify a different model per provider. Each provider typically requires its own model identifier (e.g. gpt-5-mini for OpenAI, mistral-large-latest for Mistral), but the current API only accepts a single model value.

Current behavior

Via attributes:

#[Provider([Lab::OpenAI, Lab::Mistral])]
#[Model('gpt-5-mini')]
class WorkoutProgrammerAgent implements Agent, Conversational, HasTools

#[Model] only accepts one value — there's no way to map a model to each provider.

Via prompt method:

(new WorkoutProgrammerAgent($workoutPlan))
    ->prompt((string) $prompt, provider: [Lab::OpenAI, Lab::Mistral], model: 'gpt-5-mini');

Same limitation — model is a single string with no per-provider mapping.

Expected behavior

Something like:

#[Provider([Lab::OpenAI, Lab::Mistral])]
#[Model(['gpt-5-mini', 'mistral-large-latest'])]

or:

->prompt($prompt, provider: [
    Lab::OpenAI => 'gpt-5-mini',
    Lab::Mistral => 'mistral-large-latest',
]);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions