CAMEL-23500: Document camel-openai usage with OpenAI-compatible providers#23614
CAMEL-23500: Document camel-openai usage with OpenAI-compatible providers#23614k-krawczyk wants to merge 1 commit into
Conversation
…ders Add an "OpenAI-Compatible Providers" section to the OpenAI component docs with baseUrl-based configuration examples for OpenRouter, Ollama, LM Studio, and vLLM, so users discover that no separate component is needed. For OpenRouter, document selecting models via cross-provider identifiers and controlling provider routing/fallbacks through additionalBodyProperty (a JSON body value). Note that OpenRouter's optional HTTP-Referer/X-Title attribution headers cannot be set today, since the component does not expose custom HTTP request headers.
gnodet
left a comment
There was a problem hiding this comment.
Documentation-only addition — well-written guide for using camel-openai with OpenAI-compatible providers (Ollama, LM Studio, vLLM, OpenRouter). The provider routing example for OpenRouter with additionalBodyProperty.provider is particularly useful, and the note about the limitation with custom HTTP headers is transparent.
Good use of AsciiDoc tabs for Java/YAML examples. Provider table is clean and actionable.
LGTM.
Fully automatic review from Claude Code
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
|
🧪 CI tested the following changed modules:
All tested modules (8 modules)
|
|
Hi @k-krawczyk thanks for your contribution! I added a couple of comments |
Summary
Adds an "OpenAI-Compatible Providers" section to the OpenAI component documentation, with
baseUrl-based configuration examples for OpenRouter, Ollama, LM Studio, and vLLM. This makes it discoverable that no separate component is needed to use third-party gateways or local model servers.Changes
== OpenAI-Compatible Providerssection inopenai-component.adoc:baseUrlreference table (OpenAI, OpenRouter, Ollama, LM Studio, vLLM)additionalBodyProperty(a JSON body value)Docs-only; no code changes. The
docs/components/.../openai-component.adocpage is a symlink to the component source, so only the source file changes.On the OpenRouter attribution headers
The ticket also asked to document setting OpenRouter's
HTTP-Referer/X-Titleattribution headers via exchange headers. After checking the code, the component does not currently expose a way to set custom HTTP request headers: the client is built with onlyapiKey/baseUrl/SSL and the producer calls.create(params)withoutRequestOptions. So I documented this as a current limitation rather than referencing a non-existent option. I'd suggest a small follow-up enhancement to add a custom request-header option (e.g.additionalRequestHeader.), which theopenai-javaSDK supports viaRequestOptions.putHeader— happy to take that on.On a dedicated OpenRouter kamelet
The ticket asked to evaluate one. Given
baseUrlreduces OpenRouter to a one-line configuration, a dedicated kamelet adds little value over the documented approach, so I'd lean against it.Reported by Claude Code on behalf of Karol Krawczyk