Interface EmbeddingProviderInfo

Info about a specific embedding provider

Field

displayName - The prettified name of the provider (as shown in the portal)

Field

url - The embeddings endpoint used for the provider

Field

supportedAuthentication - Enabled methods of auth for the provider

Field

parameters - Any additional parameters the provider may take in

Field

models - The specific models that the provider supports

See

FindEmbeddingProvidersResult

interface EmbeddingProviderInfo {
    displayName: string;
    models: EmbeddingProviderModelInfo[];
    parameters: EmbeddingProviderProviderParameterInfo[];
    supportedAuthentication: Record<string, EmbeddingProviderAuthInfo>;
    url: string;
}

Properties

displayName: string

The prettified name of the provider (as shown in the Astra portal).

Example

// openai.displayName:
'OpenAI'

The specific models that the provider supports.

May include an endpoint-defined-model for some providers, such as huggingfaceDedicated, where the model may be truly arbitrary.

Example

// nvidia.models[0]
{
  name: 'NV-Embed-QA',
  vectorDimension: 1024,
  parameters: [],
}

// huggingfaceDedicated.models[0]
{
  name: 'endpoint-defined-model',
  vectorDimension: null,
  parameters: [{
  name: 'vectorDimension',
  type: 'number',
  required: true,
  defaultValue: '',
  validation: {
  numericRange: [2, 3072],
  },
  help: 'Vector dimension to use in the database, should be the same as ...',
  }],
}

Any additional, arbitrary parameters the provider may take in. May or may not be required.

Passed into the parameters block in VectorizeServiceOptions (except for vectorDimension).

Example

// openai.parameters[1]
{
  name: 'projectId',
  type: 'STRING',
  required: false,
  defaultValue: '',
  validation: {},
  help: 'Optional, OpenAI Project ID. If provided passed as `OpenAI-Project` header.',
}
supportedAuthentication: Record<string, EmbeddingProviderAuthInfo>

Supported methods of authentication for the provider.

Possible methods include HEADER, SHARED_SECRET, and NONE.

  • HEADER: Authentication using direct API keys passed through headers on every Data API call. See EmbeddingHeadersProvider for more info.
const collection = await db.createCollection('my_coll', {
  service: {
  provider: 'openai',
  modelName: 'text-embedding-3-small',
  authentication: {
  // Name of the key in Astra portal's OpenAI integration (KMS).
  providerKey: '*KEY_NAME*',
  },
  },
});
  • SHARED_SECRET: Authentication tied to a collection at collection creation time using the Astra KMS.
const collection = await db.collection('my_coll', {
  // Not tied to the collection; can be different every time.
  embeddingApiKey: 'sk-...',
});
  • NONE: For when a client doesn't need authentication to use (e.g. nvidia).
const collection = await db.createCollection('my_coll', {
  service: {
  provider: 'nvidia',
  modelName: 'NV-Embed-QA',
  },
});

Example

// openai.supportedAuthentication.HEADER:
{
  enabled: true,
  tokens: [{
  accepted: 'x-embedding-api-key',
  forwarded: 'Authorization',
  }],
}
url: string

The embeddings endpoint used for the provider.

May use a Python f-string-style string interpolation pattern for certain providers which take in additional parameters (such as huggingfaceDedicated or azureOpenAI).

Example

// openai.url:
'https://api.openai.com/v1/'

// huggingfaceDedicated.url:
'https://{endpointName}.{regionName}.{cloudName}.endpoints.huggingface.cloud/embeddings'