Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Cortex currently supports two inference engines:

Before installation, ensure that you have installed the following:

- **Node.js**: Required for running the installation.
- **Node.js**: version 18 and above is required to run the installation.
- **NPM**: Needed to manage packages.
- **CPU Instruction Sets**: Available for download from the [Cortex GitHub Releases](https://github.com/janhq/cortex/releases) page.

Expand Down
3 changes: 1 addition & 2 deletions cortex-js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ Cortex
### **Dependencies**

Before installation, ensure that you have installed the following:

- **Node.js**: Required for running the installation.
- **Node.js**: version 18 and above is required to run the installation.
- **NPM**: Needed to manage packages.
- **CPU Instruction Sets**: Available for download from the [Cortex GitHub Releases](https://github.com/janhq/cortex/releases) page.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ export class EmbeddingsController {
constructor(private readonly chatService: ChatUsecases) {}

@ApiOperation({
summary: 'Embedding vector for text',
description: 'Creates an embedding vector representing the input text..',
summary: 'Create embedding vector',
description: 'Creates an embedding vector representing the input text.',
})
@HttpCode(200)
@ApiResponse({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@ import { UsageDto } from './usage.dto';

export class EmbeddingsResponseDto {
@ApiProperty({
description: 'Result object type.',
description: 'Type of the result object.',
type: String,
})
object: string;

@ApiProperty({
description: 'ID of the model used for embeddings',
description: 'Identifier of the model utilized for generating embeddings.',
type: String,
})
model: string;

@ApiProperty({
description: 'The embedding vector, which is a list of floats. ',
description: 'The embedding vector represented as an array of floating-point numbers. ',
type: [Number],
})
embedding: [number];

@ApiProperty({
description: 'Returns prompt_tokens and total_tokens usage ',
description: 'Details of token usage, including prompt_tokens and total_tokens.',
type: UsageDto,
})
usage: UsageDto;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,29 @@ import { ApiProperty } from '@nestjs/swagger';

export class CreateEmbeddingsDto {
@ApiProperty({
description: 'Embedding model',
description: 'The name of the embedding model to be used.',
type: String,
})
model: string;

@ApiProperty({
description:
'Input text to embed, encoded as a string or array of tokens. To embed multiple inputs in a single request, pass an array of strings or array of token arrays.',
'The text or token array(s) to be embedded. This can be a single string, an array of strings, or an array of token arrays to embed multiple inputs in one request.',
type: [String],
})
input: string | string[];

@ApiProperty({
description:
'Encoding format for the embeddings. Supported formats are float and int.',
'Specifies the format for the embeddings. Supported formats include `float` and `int`. This field is optional.',
type: String,
})
@Optional()
encoding_format?: string;

@ApiProperty({
description:
'The number of dimensions the resulting output embeddings should have. Only supported in some models.',
'Defines the number of dimensions for the output embeddings. This feature is supported by certain models only. This field is optional.',
type: Number,
})
@Optional()
Expand Down
4 changes: 4 additions & 0 deletions cortex-js/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ async function bootstrap() {
'Threads',
'These endpoints handle the creation, retrieval, updating, and deletion of conversation threads.',
)
.addTag(
'Embeddings',
'Endpoint for creating and retrieving embedding vectors from text inputs using specified models.',
)
.addServer('http://localhost:1337')
.addServer('http://localhost:1337/v1')
.build();
Expand Down