> For the complete documentation index, see [llms.txt](https://docs.graphlit.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.graphlit.dev/api-guides/use-cases/specifications/specification-create-embedding.md).

# 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

```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

```python
from graphlit import Graphlit
from graphlit_api.enums import ModelServiceTypes, OpenAiModels, SpecificationTypes
from graphlit_api.input_types import (
    EmbeddingsStrategyInput,
    EntityReferenceInput,
    OpenAiModelPropertiesInput,
    ProjectUpdateInput,
    SpecificationInput,
)

graphlit = Graphlit()

spec = await graphlit.client.create_specification(
    SpecificationInput(
        name="OpenAI Embedding 3 Large",
        type=SpecificationTypes.TEXT_EMBEDDING,
        service_type=ModelServiceTypes.OPEN_AI,
        open_ai=OpenAiModelPropertiesInput(
            model=OpenAiModels.EMBEDDING_3_LARGE,
            chunk_token_limit=512,
        ),
    )
)

await graphlit.client.update_project(
    ProjectUpdateInput(
        embeddings=EmbeddingsStrategyInput(
            text_specification=EntityReferenceInput(id=spec.create_specification.id)
        )
    )
)
```

## C\#

```csharp
using GraphlitClient;
using System.Net.Http;
using StrawberryShake;

using var httpClient = new HttpClient();
var client = new Graphlit(httpClient);

var spec = await client.Client.CreateSpecification.ExecuteAsync(new SpecificationInput(
    name: "OpenAI Embedding 3 Large",
    type: SpecificationTypes.TextEmbedding,
    serviceType: ModelServiceTypes.OpenAi,
    openAi: new OpenAiModelPropertiesInput(
        model: OpenAiModels.Embedding_3Large,
        chunkTokenLimit: 512
    )
));

await client.Client.UpdateProject.ExecuteAsync(new ProjectUpdateInput(
    embeddings: new EmbeddingsStrategyInput(
        textSpecification: new EntityReferenceInput(spec.Data!.CreateSpecification!.Id)
    )
));
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.graphlit.dev/api-guides/use-cases/specifications/specification-create-embedding.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
