For the complete documentation index, see llms.txt. This page is also available as Markdown.

Create Embedding Model

User Intent

"I want to configure which embedding model to use for vector (semantic) search"

Operation

  • SDK Methods: createSpecification(), updateProject()

  • GraphQL: createSpecification, updateProject

TypeScript

import { Graphlit } from 'graphlit-client';
import { ModelServiceTypes, OpenAiModels, SpecificationTypes } from 'graphlit-client/dist/generated/graphql-types';

const graphlit = new Graphlit();

// 1) Create a text-embedding specification
const spec = await graphlit.createSpecification({
  name: 'OpenAI Embedding 3 Large',
  type: SpecificationTypes.TextEmbedding,
  serviceType: ModelServiceTypes.OpenAi,
  openAI: {
    model: OpenAiModels.Embedding_3Large,
    chunkTokenLimit: 512,
  },
});

// 2) Set it as the project default text embedding strategy
await graphlit.updateProject({
  embeddings: {
    textSpecification: { id: spec.createSpecification.id },
  },
});

Python

C#

Last updated