{"record":{"id":"5c9a2491ccf95f13","repo":"xtekky/gpt4free","slug":"config-yaml-no-provider-succeeded-for-model-mode","errorCode":null,"errorMessage":"config.yaml: No provider succeeded for model {model!r}. Tried: {tried}","messagePattern":"config\\.yaml: No provider succeeded for model (.+?)\\. Tried: (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"critical","filePath":"g4f/providers/config_provider.py","lineNumber":600,"sourceCode":"                return  # Success\n            except Exception as e:\n                # On rate-limit errors invalidate the quota cache\n                from ..errors import RateLimitError\n\n                if isinstance(e, RateLimitError) or \"429\" in str(e):\n                    debug.log(\n                        f\"config.yaml: Rate-limited by {provider_name}, \"\n                        \"invalidating quota cache\"\n                    )\n                    QuotaCache.invalidate(provider_name)\n\n                ErrorCounter.increment(provider_name)\n                last_exception = e\n                debug.error(f\"config.yaml: {provider_name} failed:\", e)\n\n        if last_exception is not None:\n            raise last_exception\n        raise RuntimeError(\n            f\"config.yaml: No provider succeeded for model {model!r}. \"\n            f\"Tried: {tried}\"\n        )\n","sourceCodeStart":582,"sourceCodeEnd":604,"githubUrl":"https://github.com/xtekky/gpt4free/blob/973504e1770928ed5fb82f43da528f441ad9ddc3/g4f/providers/config_provider.py#L582-L604","documentation":"RuntimeError raised at the end of config_provider's generator chain: every provider listed in config.yaml for the requested model was attempted and all raised (or none were eligible), with no last_exception retained the loop falls through to this summary error naming the model and the tried provider list. When a concrete exception exists it is re-raised instead, so this message means total failure with nothing better to surface.","triggerScenarios":"Calling the config-based provider chain for a model where every configured provider fails (auth errors, network, model not offered) — each failure is logged, counted in ErrorCounter, and after the loop the RuntimeError with the tried list is raised.","commonSituations":"All configured providers lack credentials on a fresh machine; the model name in the request matches config.yaml but no provider actually serves it; an upstream outage taking down every free provider at once.","solutions":["Enable debug logging (g4f.debug.logging = True) and read the per-provider 'config.yaml: <provider> failed:' lines to see each root cause.","Fix the most common single cause first (usually missing auth or one bad model mapping) — often one fix revives several providers.","Add more providers to config.yaml for the model, or verify the model is offered by at least one entry.","If all providers are rate-limited (see QuotaCache invalidation logs), wait and retry later."],"exampleFix":"# before (config.yaml)\nmodel: gpt-4o\nproviders:\n  - provider: \"ProviderA\"   # every entry failing\n\n# after\nmodel: gpt-4o\nproviders:\n  - provider: \"ProviderA\"\n  - provider: \"OpenaiChat\"  # fallback that works","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    result = await config_chain(model, messages)\nexcept RuntimeError as e:\n    if 'No provider succeeded' in str(e):\n        logging.error('config chain exhausted: %s', e)\n        result = await manual_fallback(model, messages)  # known-good authed provider\n    else:\n        raise","preventionTips":["Keep at least one authenticated, known-good provider in every model chain.","Turn on g4f.debug.logging to see per-provider root causes inside the chain.","Treat this error as a chain-wide outage: fix common causes (auth, model mapping) before retrying."],"tags":["config","yaml","provider-chain","all-providers-failed","g4f"],"backgroundTag":null,"analyzedSha":"973504e1770928ed5fb82f43da528f441ad9ddc3","analyzedAt":"2026-08-14T23:45:32.408Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}