Skip to content

Commit

Permalink
make models configurable
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Olivier <[email protected]>
  • Loading branch information
alexolivier committed Dec 4, 2024
1 parent 300ce4f commit 8d77085
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ DATABASE_URL="file:./dev.db"
CHROMA_PORT=5666
CHROMA_ENDPOINT=http://localhost:${CHROMA_PORT}
CHROME_PERSIST_DIRECTORY=./chroma
EMBEDDING_MODEL=mxbai-embed-large
LLM=llama3.1
8 changes: 5 additions & 3 deletions app/lib/llm.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,24 @@ import { Principal } from "./users";

const OLLAMA_ENDPOINT = process.env.OLLAMA_ENDPOINT || "http://localhost:11434";
const CHROMA_ENDPOINT = process.env.CHROMA_ENDPOINT || "http://localhost:5666";
const EMBEDDING_MODEL = process.env.EMBEDDING_MODEL || "mxbai-embed-large";
const LLM = process.env.LLM || "llama3.1";

export const CHROMA_COLLECTION_NAME =
process.env.CHROMA_COLLECTION_NAME || "expense_dev";

const llm = new Ollama({
baseUrl: OLLAMA_ENDPOINT,
model: "llama3.1", // Default value
model: LLM, // Default value
temperature: 0,
maxRetries: 2,
});

const embeddings = new OllamaEmbeddings({
model: "mxbai-embed-large", // Default value
model: EMBEDDING_MODEL, // Default value
baseUrl: OLLAMA_ENDPOINT, // Default value
});

console.log(CHROMA_ENDPOINT);
export const vectorStore = new Chroma(embeddings, {
collectionName: CHROMA_COLLECTION_NAME,
url: CHROMA_ENDPOINT, // Optional, will default to this value
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8d77085

Please sign in to comment.