Skip to content

CAMEL-23500: Document camel-openai usage with OpenAI-compatible providers#23614

Open
k-krawczyk wants to merge 1 commit into
apache:mainfrom
k-krawczyk:CAMEL-23500-document-openai-compatible-providers
Open

CAMEL-23500: Document camel-openai usage with OpenAI-compatible providers#23614
k-krawczyk wants to merge 1 commit into
apache:mainfrom
k-krawczyk:CAMEL-23500-document-openai-compatible-providers

Conversation

@k-krawczyk
Copy link
Copy Markdown
Contributor

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

  • New == OpenAI-Compatible Providers section in openai-component.adoc:
    • Provider → baseUrl reference table (OpenAI, OpenRouter, Ollama, LM Studio, vLLM)
    • Per-provider examples (Ollama, LM Studio, vLLM)
    • OpenRouter: cross-provider model identifiers and provider routing/fallbacks via additionalBodyProperty (a JSON body value)

Docs-only; no code changes. The docs/components/.../openai-component.adoc page 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-Title attribution 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 only apiKey/baseUrl/SSL and the producer calls .create(params) without RequestOptions. 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 the openai-java SDK supports via RequestOptions.putHeader — happy to take that on.

On a dedicated OpenRouter kamelet

The ticket asked to evaluate one. Given baseUrl reduces 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

…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.
Copy link
Copy Markdown
Contributor

@gnodet gnodet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@github-actions
Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@github-actions
Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • components/camel-ai/camel-openai

⚠️ Some tests are disabled on GitHub Actions (@DisabledIfSystemProperty(named = "ci.env.name")) and require manual verification:

  • components/camel-ai/camel-openai: 6 test(s) disabled on GitHub Actions
All tested modules (8 modules)
  • Camel :: AI :: OpenAI
  • Camel :: JBang :: MCP
  • Camel :: JBang :: Plugin :: Route Parser
  • Camel :: JBang :: Plugin :: TUI
  • Camel :: JBang :: Plugin :: Validate
  • Camel :: Launcher :: Container
  • Camel :: YAML DSL :: Validator
  • Camel :: YAML DSL :: Validator Maven Plugin

⚙️ View full build and test results

@Croway
Copy link
Copy Markdown
Contributor

Croway commented May 29, 2026

Hi @k-krawczyk thanks for your contribution! I added a couple of comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants