Skip to content

Conversation

franciscojavierarceo
Copy link
Collaborator

@franciscojavierarceo franciscojavierarceo commented Aug 2, 2025

What does this PR do?

This PR adds support for for Chunks in the new OpenAI Vector Stores API. In particular, it adds the following APIs:

  • @webmethod(route="/openai/v1/vector_stores/{vector_store_id}/files/{file_id}/chunks", method="GET")
  • @webmethod(route="/openai/v1/vector_stores/{vector_store_id}/files/{file_id}/chunks/{chunk_id}", method="GET")
  • @webmethod(route="/openai/v1/vector_stores/{vector_store_id}/files/{file_id}/chunks/{chunk_id}", method="POST")
  • @webmethod(route="/openai/v1/vector_stores/{vector_store_id}/files/{file_id}/chunks/{chunk_id}", method="DELETE")

It's worth noting that these APIs aren't actually available from OpenAI but they are consistent with them and are likely what they expose internally (but that's just speculation on my part).

As mentioned in this issue, this is needed for supporting the ingestion of precomputed embeddings, similar to what's available with VectorIO today.

See this example here that is in use at Red Hat: https://github.com/opendatahub-io/rag/tree/main/demos/kfp/docling/pdf-conversion

I enabled the ingestion of precomputed embeddings in #2317, which has been used by a number of our customers via VectorIO.insert(). This would give us feature parity and be consistent with OpenAI's naming conventions.

Other thoughts

I also have a PoC of how this can be exposed in the UI. A screenshot is available below:

Screenshot 2025-08-01 at 11 24 56 PM

Closes #3021

Test Plan

Unit tests added.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Aug 2, 2025
@mattf
Copy link
Collaborator

mattf commented Aug 2, 2025

discussion of this is happening on #2981

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Meta Open Source bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create GET (+list), UPDATE, and DELETE APiIs for Chunks in Vector Stores API
2 participants