buildProviderChain

fun buildProviderChain(config: AiProviderConfig, fallback: AiProvider, onDevice: AiProvider? = null): List<AiProvider>

Builds the provider fallback chain from config: on-device first (if enabled and onDevice is supplied) → configured cloud providers (Anthropic/OpenAI/Gemini, in that priority order) → fallback last. onDevice and fallback are caller-supplied rather than hardcoded — this module ships no on-device LLM or app-specific offline fallback of its own.