Sourcegraph DocsSourcegraph Docs
  • Code Intelligence

    • Cody
    • Code Search
  • Code Management

    • Batch Changes
    • Code Navigation
    • Code Monitoring
    • Code Ownership
    • Code Insights
    • Notebooks
  • Platform

    • Sourcegraph Admin
    • Sourcegraph Cloud
    • Integrations
  • CLI & API

    • Sourcegraph CLI
    • Sourcegraph GraphQL API
    • Sourcegraph Stream API
  • Help & Support

    • SLAs & Premium Support
    • Tutorials
    • Sourcegraph Accounts
    • Changelog
  1. Docs
  2. cody
  3. embeddings
  4. usage-and-limits

Usage and Limits

Learn about all the usage polices and limits that apply while using embeddings.

These docs are only valid for Sourcegraph versions >5.2. As of Sourcegraph version 5.3, embeddings are only available to Cody Free and Cody Pro users on the VS Code extension.

Configure global policy match limit

A global policy refers to an embeddings policy without a pattern. By default, it is applied to up to 5000 repositories. The repositories matching the policy are first sorted by star count (descending) and id (descending) and then the first 5000 repositories are selected.

You can configure the limit by setting the policyRepositoryMatchLimit property in the embeddings configuration. A negative value disables the limit and all repositories are selected.

{ // [...] "embeddings": { // [...] "policyRepositoryMatchLimit": 5000 } }

Limit the number of embeddings that can be generated

The number of embeddings that can be generated per repo is limited to embeddings.maxCodeEmbeddingsPerRepo for code embeddings (default 3.072.000) or embeddings.maxTextEmbeddingsPerRepo (default 512.000) for text embeddings.

Use the following site configuration to update the limits:

{ "embeddings": { "maxCodeEmbeddingsPerRepo": 3072000, "maxTextEmbeddingsPerRepo": 512000 } }

On this page

  1. Usage and Limits

    1. Configure global policy match limit
    1. Limit the number of embeddings that can be generated
Edit this page on GitHub