Allow custom embeddings ?

Open
#203 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
huggingface, ollama, python
Domain
ai, backend

Research direction

Start in chains.py at load_embedding_model, specifically the OllamaEmbeddings branch around lines 36-39. Review how the current model and configuration are selected, then determine the intended configuration for a custom model name and embedding dimension. Done means the requested embedding choices can be selected without changing the source code.

Written by the indexing model from the issue text.

Description

I am not sure if it is a good idea.. just AI amateur-enthusiast here. but i would like to try different embeddings. selecting ollama as embedding defaults to llama2.. but could we mb use env var for that
mb allow modifying dimension also?

option 1: separate variable for name
EMBEDDING_MODEL=ollama
EMBEDDING_MODEL_NAME=nomic-embed-text

option 2: spliting value (not ideal i guess)
EMBEDDING_MODEL=ollama/nomic-embed-text

Alt: mb allow fully custom HuggingFaceEmbeddings ?

in load_embedding_model (chains.py@L36-39):
if embedding_model_name == "ollama":
embeddings = OllamaEmbeddings(
base_url=config["ollama_base_url"], model="llama2"
)

Dominant language
Python
Stars
5.4k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from docker/genai-stack

All issues in docker/genai-stack

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.