A platform for community discussion. Free, open, simple.
FIX: Use standard `Authorization` Bearer header for vLLM (#40409)
Rafael dos Santos Silva5c323436a260
diff --git a/plugins/discourse-ai/lib/completions/endpoints/vllm.rb b/plugins/discourse-ai/lib/completions/endpoints/vllm.rbindex 40e8680bdd5..50ace7d2947 100644--- a/plugins/discourse-ai/lib/completions/endpoints/vllm.rb+++ b/plugins/discourse-ai/lib/completions/endpoints/vllm.rb@@ -85,7 +85,7 @@ module DiscourseAiheaders = { "Referer" => Discourse.base_url, "Content-Type" => "application/json" }api_key = llm_model&.api_key || SiteSetting.ai_vllm_api_key- headers["X-API-KEY"] = api_key if api_key.present?+ headers["Authorization"] = "Bearer #{api_key}" if api_key.present?Net::HTTP::Post.new(model_uri, headers).tap { |r| r.body = payload }end