Skip to content

[ENH] Allow users to define null EFs on create collection #5134

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 22, 2025

Conversation

itaismith
Copy link
Contributor

Description of changes

Allow users to explicitly define null EF when creating collections. This is intended for users who want to provide embeddings directly to a collection and don't want to install the default embed package.

Test plan

  • Tests pass locally with pytest for python, yarn test for js, cargo test for rust

Documentation Changes

In this PR

@itaismith itaismith requested a review from jairad26 July 22, 2025 18:00
Copy link

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

Copy link
Contributor

Allow Explicit Null Embedding Functions When Creating Collections

This PR enhances the Chroma collection API in the new JavaScript client to allow users to explicitly set the embedding function (EF) to null when creating collections. This enables workflows where users want to provide their own embeddings directly, bypassing the need for any installed embedding package. The change is accompanied by updated documentation, including new usage examples for both Python and TypeScript clients.

Key Changes

• Updated type signatures in the JS client to accept embeddingFunction: EmbeddingFunction | null during collection creation and getOrCreate operations.
• Modified processCreateCollectionConfig to correctly handle explicit nulls for embeddingFunction (no default EF assigned if null).
• Expanded documentation (collections/manage-collections.md) with usage guidance and examples for collections without embedding functions in both Python and TypeScript.

Affected Areas

• JavaScript Chroma client (collection-configuration.ts, chroma-client.ts)
• Collection creation API
• Reference documentation for managing collections

This summary was automatically generated by @propel-code-bot

@itaismith itaismith merged commit 82edbdd into main Jul 22, 2025
58 checks passed
Inventrohyder pushed a commit to Inventrohyder/chroma that referenced this pull request Aug 5, 2025
…e#5134)

## Description of changes

Allow users to explicitly define `null` EF when creating collections.
This is intended for users who want to provide embeddings directly to a
collection and don't want to install the default embed package.

## Test plan

- [ ] Tests pass locally with `pytest` for python, `yarn test` for js,
`cargo test` for rust

## Documentation Changes

In this PR
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