Skip to content

Commit

Permalink
feat(models): nomic-embed-text
Browse files Browse the repository at this point in the history
  • Loading branch information
Leo310 committed Feb 27, 2024
1 parent 045fce3 commit 907f47a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "papa-ts",
"version": "0.2.0",
"version": "0.3.0",
"description": "Backend for your Personal Assistant, powered by Private AI (aka PAPA)",
"main": "dist/index",
"types": "dist/index",
Expand Down
23 changes: 15 additions & 8 deletions src/Models.ts
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
export const OpenAIGenModels = {
'gpt-3.5-turbo': {
maxTokens: 4096,
contextWindow: 4096,
description: 'GPT-3.5 Turbo (4096 Tokens)',
},
'gpt-3.5-turbo-1106': {
maxTokens: 16385,
contextWindow: 16385,
description: 'Latest GPT-3.5 Turbo (16385 Tokens)',
},
'gpt-4': {
maxTokens: 8192,
contextWindow: 8192,
description: 'GPT-4 (8192 Tokens)',
},
'gpt-4-32k': {
maxTokens: 32768,
contextWindow: 32768,
description: 'GPT-4 (32768 Tokens)',
},
'gpt-4-1106-preview': {
maxTokens: 128000,
contextWindow: 128000,
description: 'Latest GPT-4 (128000 Tokens)',
},
};

export const OpenAIEmbedModels = {
'text-embedding-ada-002': {
vectorSize: 1536,
maxTokens: 8191,
contextWindow: 8191,
description: 'Text Embedding ADA 002',
},
};

export const OllamaGenModels = {
llama2: {
maxTokens: 4096,
contextWindow: 4096,
description: 'Llama-2 (4096 Tokens)',
},
mistral: {
maxTokens: 8000,
contextWindow: 8000,
description: 'Mistral (8000 Tokens)',
},
};
Expand All @@ -49,6 +49,11 @@ export const OllamaEmbedModels = {
vectorSize: 4096,
description: 'Mistral Embedding',
},
'nomic-embed-text': {
vectorSize: 768,
description: 'Nomic Embedding',
contextWindow: 8192,
},
};

export const OpenAIGenModelNames = Object.keys(OpenAIGenModels) as (keyof typeof OpenAIGenModels)[];
Expand All @@ -65,6 +70,7 @@ export const OpenAIEmbedModelNames = Object.keys(OpenAIEmbedModels) as (keyof ty
export interface OpenAIEmbedModel {
modelName: keyof typeof OpenAIEmbedModels;
openAIApiKey: string;
similarityThreshold?: number;
}
export const isOpenAIEmbedModel = (model: any): model is OpenAIEmbedModel => {
return OpenAIEmbedModelNames.includes(model.modelName);
Expand All @@ -84,6 +90,7 @@ export const OllamaEmbedModelNames = Object.keys(OllamaEmbedModels) as (keyof ty
export interface OllamaEmbedModel {
model: keyof typeof OllamaEmbedModels;
baseUrl: string;
similarityThreshold?: number;
}
export const isOllamaEmbedModel = (model: any): model is OllamaEmbedModel => {
return OllamaEmbedModelNames.includes(model.model);
Expand Down

0 comments on commit 907f47a

Please sign in to comment.