Skip to content

CAMEL-22545 new camel-huggingface component#21449

Merged
johnpoth merged 1 commit intoapache:mainfrom
johnpoth:huggingface
Feb 19, 2026
Merged

CAMEL-22545 new camel-huggingface component#21449
johnpoth merged 1 commit intoapache:mainfrom
johnpoth:huggingface

Conversation

@johnpoth
Copy link
Member

@johnpoth johnpoth commented Feb 13, 2026

Description

https://issues.apache.org/jira/browse/CAMEL-22545

This introduces a new camel-huggingface component that provides an easy-to-use integration with the Hugging Face models. It leverages the Deep Java Library (DJL) Python engine to run Hugging Face Transformers pipelines directly.

For example, to use the Qwen2.5-3B-Instruct model:

from("direct:start-chat")
    .to("huggingface:chat?modelId=Qwen/Qwen2.5-3B-Instruct");

Thanks !

Target

  • I checked that the commit is targeting the correct branch (Camel 4 uses the main branch)

Tracking

  • If this is a large change, bug fix, or code improvement, I checked there is a JIRA issue filed for the change (usually before you start working on it).

Apache Camel coding standards and style

  • I checked that each commit in the pull request has a meaningful subject line and body.
  • I have run mvn clean install -DskipTests locally from root folder and I have committed all auto-generated changes.

<dependency>
<groupId>ai.djl.python</groupId>
<artifactId>python</artifactId>
<version>0.28.0</version>
Copy link
Contributor

Choose a reason for hiding this comment

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

can this be externalised to the parent pom?

@jamesnetherton
Copy link
Contributor

@johnpoth johnpoth force-pushed the huggingface branch 3 times, most recently from 5e20dbe to d79b07c Compare February 16, 2026 10:05
@johnpoth johnpoth force-pushed the huggingface branch 2 times, most recently from f42691e to f477103 Compare February 16, 2026 13:02
@johnpoth
Copy link
Member Author

Done, thanks for reviewing!

String doSample = config.getTemperature() > 0 ? "True" : "False";
float temperature = config.getTemperature() > 0 ? config.getTemperature() : 1.0f;
String tokenClause = config.getAuthToken() != null ? ", token='" + config.getAuthToken() + "'" : "";
return """
Copy link
Contributor

Choose a reason for hiding this comment

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

@johnpoth this not a blocker, but what about moving the python code under the resources folder in its .py file? so that it can be retrieved and returned by these getPythonScript()

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks @Croway for the feedback! I've implemented the changes

@davsclaus
Copy link
Contributor

We have released so the version should be bumped to 4.19.0-SNAPSHOT and so forth

@github-actions
Copy link
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 build-all, build-dependents, 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.

@johnpoth
Copy link
Member Author

Ok I think we can merge now

@johnpoth johnpoth merged commit d7fecf3 into apache:main Feb 19, 2026
5 checks passed
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.

5 participants

Comments