Skip to content

Commit

Permalink
Add support for Fireworks embedding model***
Browse files Browse the repository at this point in the history
  • Loading branch information
n4ze3m committed Feb 19, 2024
1 parent 0b68717 commit 08a13b2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
6 changes: 6 additions & 0 deletions server/prisma/seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,12 @@ const EMBEDDING_MODELS: {
name: "text-embedding-3-large (OpenAI)",
model_type: "embedding",
model_provider: "OpenAI",
},
{
model_provider: "Fireworks",
model_type: "embedding",
model_id: "dialoqbase_eb_nomic-ai/nomic-embed-text-v1.5",
name: "nomic-ai/nomic-embed-text-v1.5 (Fireworks)",
}
];

Expand Down
10 changes: 10 additions & 0 deletions server/src/utils/embeddings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,15 @@ export const embeddings = (
},
},
});
case "fireworks":
return new OpenAIEmbeddings({
modelName,
openAIApiKey: process.env.FIREWORKS_API_KEY!,
configuration: {
baseURL: "https://api.fireworks.ai/inference/v1",
apiKey: process.env.FIREWORKS_API_KEY!,
},
});
default:
console.log("Using Default Embeddings");
return new OpenAIEmbeddings();
Expand All @@ -96,4 +105,5 @@ export const supportedEmbeddings = [
"supabase",
"jina",
"google",
"fireworks",
];
2 changes: 1 addition & 1 deletion server/src/utils/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const chatModelProvider = (
return new ChatOpenAI({
modelName: modelName,
temperature: temperature,
openAIApiKey: otherFields.apiKey || process.env.OPENAI_API_KEY,
openAIApiKey: otherFields.apiKey || process.env.OPENAI_API_KEY ,
...otherFields,
configuration: {
baseURL: otherFields.baseURL,
Expand Down

0 comments on commit 08a13b2

Please sign in to comment.