Skip to content

Conversation

@Claude-kang
Copy link

What does this PR do?

This PR adds full support for Jina Embeddings v4 across routing, backend handling, and documentation.

Summary of changes

  • Model detection & routing

    • Detects JinaEmbeddingsV4Model and text_config fields in config.json
    • Applies sliding_window logic to respect max input length
    • Treats Jina v4 as an embedding model with mean pooling by default in the router
  • Python backend support

    • Adds a Python backend handler for Jina v4 (remote code + LoRA support)
    • Returns single_vec_emb
    • Supports automatic task selection, with optional override via JINA_V4_TASK
  • Build & test improvements

    • Improves default dtype handling for gRPC-only builds
    • Fixes tokenizer test to use the Tokio API
  • Documentation

    • Documents Jina v4 usage in the README
    • Adds Jina v4 to the supported models list

Fixes # (no issue)

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline?
  • Was this discussed/approved via a GitHub issue or the forum? (No)
  • Did you make sure to update the documentation with your changes? (README + supported_models)
  • Did you write any new necessary tests?
    - Workspace tests
    - Jina integration tests
    - Tokenizer test updated to use Tokio API

Who can review?

@Narsil
@alvarobartt

@Claude-kang Claude-kang changed the title Feat/jina embeddings v4 feat/jina embeddings v4 Dec 26, 2025
@Claude-kang Claude-kang marked this pull request as draft December 26, 2025 07:26
all(feature = "candle", not(feature = "accelerate"))
))]
Float16,
#[cfg(any(feature = "python", feature = "candle", feature = "ort"))]
Copy link
Contributor

Choose a reason for hiding this comment

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

should not be removed.

tracer = trace.get_tracer(__name__)


class JinaV4Model(Model):
Copy link
Contributor

Choose a reason for hiding this comment

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

why not implement JinaV4Model in candle? Its much faster than torch here, actually (because you have to use PaddedBatch)

@Claude-kang Claude-kang force-pushed the feat/jina-embeddings-v4 branch from 8d476ff to 54ff24b Compare December 29, 2025 05:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants