{"record":{"id":"b567a3e62cf83c54","repo":"we-promise/sure","slug":"no-llm-provider-configured-that-supports-model","errorCode":null,"errorMessage":"No LLM provider configured that supports model '#{requested_model}'.\\n\\nAvailable providers:\\n#{provider_details}\\n\\nPlease either:\\n  1. Use a supported model from the list above, or\\n  2. Configure a provider that supports '#{requested_model}' in settings.","messagePattern":"No LLM provider configured that supports model '#(.+?)'\\.\\\\n\\\\nAvailable providers:\\\\n#(.+?)\\\\n\\\\nPlease either:\\\\n  1\\. Use a supported model from the list above, or\\\\n  2\\. Configure a provider that supports '#(.+?)' in settings\\.","errorType":"exception","errorClass":"StandardError","httpStatus":null,"severity":"error","filePath":"app/models/assistant/builtin.rb","lineNumber":25,"sourceCode":"  class << self\n    def for_chat(chat)\n      config = config_for(chat)\n      new(chat, instructions: config[:instructions], functions: config[:functions])\n    end\n  end\n\n  def initialize(chat, instructions: nil, functions: [])\n    super(chat)\n    @instructions = instructions\n    @functions = functions\n  end\n\n  def respond_to(message, assistant_message: nil)\n    assistant_message ||= AssistantMessage.new(chat: chat, content: \"\", ai_model: message.ai_model)\n\n    llm_provider = get_model_provider(message.ai_model)\n    unless llm_provider\n      raise StandardError, build_no_provider_error_message(message.ai_model)\n    end\n\n    responder = Assistant::Responder.new(\n      message: message,\n      instructions: instructions,\n      function_tool_caller: function_tool_caller,\n      llm: llm_provider\n    )\n\n    latest_response_id = chat.latest_assistant_response_id\n\n    responder.on(:output_text) do |text|\n      if assistant_message.content.blank?\n        Chat.transaction do\n          assistant_message.append_text!(text)\n          chat.update_latest_response!(latest_response_id)\n        end\n      else","sourceCodeStart":7,"sourceCodeEnd":43,"githubUrl":"https://github.com/we-promise/sure/blob/e69894adb92547273377398c15f45c979cd9416a/app/models/assistant/builtin.rb#L7-L43","documentation":"Assistant::Builtin#respond_to resolves which LLM provider to use for the chat's requested model via get_model_provider(message.ai_model); if no configured provider (OpenAI / Anthropic settings) supports that model, it builds a diagnostic message — \"No LLM provider configured that supports model 'X'\" plus the list of available providers with their models — and raises StandardError. The message is intentionally actionable: it tells the user to either pick a supported model or configure a provider in settings.","triggerScenarios":"Sending an assistant message whose ai_model is a model string no provider advertises: provider settings were changed/removed after older chats picked that model; reopening an old conversation whose stored ai_model was retired/renamed (e.g. gpt-4-turbo-preview deprecated); only one provider configured (OpenAI) while the message requests a claude-* model, or vice versa; a typo'd or user-supplied custom model name that doesn't match the provider's configured list; provider configured but its model list setting doesn't include the custom model name.","commonSituations":"Self-hosters swapping API keys/providers and forgetting old chats keep their original model; upgrading the app retires a model name upstream providers no longer list; users pasting a model name from the internet; partial configuration — API key present but model allowlist updated.","solutions":["In the chat, switch the model selector to one listed in the error's \"Available providers\" section and resend","Or complete the provider config: Settings > Self-Hosting — add the API key (and base URL/model pair for custom endpoints) for a provider that serves the requested model","For custom/self-hosted model gateways, ensure the provider's configured model list actually contains the exact string being requested (watch versions/aliases: 'gpt-4o' vs 'gpt-4o-2024-08-06')","For stale old chats, bulk-update AssistantMessage/chat ai_model to a currently supported model or delete the chats"],"exampleFix":"# before\nmessage = chat.messages.create!(content: \"hi\", ai_model: \"claude-3-opus-20230101\")\nAssistant::Builtin.new(chat).respond_to(message)\n# => StandardError: No LLM provider configured that supports model 'claude-3-opus-20230101'. ...\n\n# after: use a model from the configured provider's list\nsupported = Assistant::Builtin.new(chat).send(:get_model_provider, \"gpt-4o\")&.configured_models rescue []\nmessage = chat.messages.create!(content: \"hi\", ai_model: \"gpt-4o\") # matches provider config\nAssistant::Builtin.new(chat).respond_to(message)","handlingStrategy":"validation","validationCode":"# Before sending, verify the requested model is served\nchat = Chat.find(chat_id)\nprovider = Assistant::Builtin.new(chat).send(:get_model_provider, chat.assistant_model)\nraise \"pick a supported model\" unless provider\n# or expose a whitelist endpoint the UI validates against","typeGuard":"def supported_model?(model_name)\n  # mirror of get_model_provider's resolution\n  [ Provider::OpenAI, Provider::Anthropic ].any? do |p|\n    p.configured? && p.supports_model?(model_name)\n  end\nend","tryCatchPattern":"begin\n  Assistant::Builtin.new(chat).respond_to(message)\nrescue StandardError => e\n  if e.message.start_with?(\"No LLM provider configured\")\n    # e.message lists available models: surface as model-picker options\n    chat.add_error(e)\n  else\n    raise\n  end\nend","preventionTips":["Restrict the chat model picker to models the current config actually serves","Migrate old chats' ai_model when retiring/renaming provider models","Keep provider model lists explicit in settings so custom names are deliberate","Parse the error's provider list programmatically to offer the user valid replacements"],"tags":["rails","llm","assistant","provider-routing","configuration"],"backgroundTag":"llm-provider-not-configured","analyzedSha":"e69894adb92547273377398c15f45c979cd9416a","analyzedAt":"2026-08-21T18:22:41.165Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}