Conversation
There was a problem hiding this comment.
My only concern would be "baking" Netty into model starter will affect other components in the User App relying on generic ClientHttpRequestFactory (without user actually knowing that the "flip" to Netty had occurred)
Maybe better approach is to explicitly instruct Users to add Netty into the mix.
We can create a dedicated starter for it.
That way Users will be aware what is going on, and it will up to the them,
making sure Netty plays along with other application components that depend on ClientHttpRequestFactory
Good point about Netty being pulled in transitively. That was actually the concern that led to the original design in #1478. The initial implementation used a self-contained This was deliberate because ONNX is the only provider that downloads large files from HuggingFace via 302 When this was later wired through the shared I don't think it is a good solution to require users to add a separate Netty starter. It means the ONNX starter doesn't work out of the box. Users would hit a cryptic RecommendationI think the better fix is to revert to the original approach: let Justification
In this case, it is better for maintainers to absorb a minor asymmetry with other providers on behalf of users - in exchange for a friction-less experience that "just works" Happy to update this PR accordingly. |
|
Is it possible to set Rest Client as default, but still have an option for Netty, similar pattern as with other Providers? Basically, I would keep both: default that works for ONYX (Rest Client if that works), and ability for users to drop in Netty Autoconfiguration if that is what they want and decide to proceed with. |
|
@alexheifetz Agreed on keeping Netty opt-in. Removed the hard dep from the ONNX starter. The fallback is now |
…e fallback when aiModelHttpRequestFactory is absent, so CDN redirects are followed in ONNX-only projects. Netty is still used when present.
49d6cd8 to
4092abb
Compare
|



Fix ONNX model download failure in CI
Problem
The Export Seed Database workflow fails because OnnxModelLoader downloads truncated files from HuggingFace (1KB instead of ~30MB), causing an ORT_INVALID_PROTOBUF crash on startup. (Currently has workaround applied: Pre-download using curl)
Context
OnnxEmbeddingAutoConfigurationpreviously used the default JDKRestClientbecause Reactor Netty didn't follow redirects, and HuggingFace serves model files via 302 redirects to CDN URLs. Since then, NettyClientAutoConfiguration was updated with.followRedirect(true)— but the ONNX config was never updated to use it.This worked locally because other starters on the classpath (e.g. OpenAI, Anthropic) pull in the netty module transitively. In CI — or any deployment where embabel-agent-starter-onnx is the only starter making HTTP downloads — the netty factory was absent, so
RestClientfell back to the default JDK HttpURLConnection client, which doesn't follow HuggingFace's cross-origin CDN redirects.Fix
Two changes to wire ONNX downloads through the shared netty-backed HTTP client:
@Qualifier("aiModelHttpRequestFactory")to OnnxEmbeddingAutoConfiguration's requestFactory parameter — matching Anthropic, OpenAI, and Ollama configs. Without this, Spring may not inject the netty-backed factory even when it's available.embabel-agent-netty-client-autoconfiguredependency toembabel-agent-starter-onnx— ensures the netty module is on the classpath even when no other starter brings it in.