[GH-ISSUE #1705] generating embeddings with OllamaEmbeddings taking forever #47475

Closed
opened 2026-04-28 03:54:17 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @lorenzoromani1983 on GitHub (Dec 25, 2023).
Original GitHub issue: https://github.com/ollama/ollama/issues/1705

I am trying to generate embeddings with the OllamaEmbeddings class but it takes forever on a Mac M2 Pro

I am embedding 22000 posts from a forum's threads; this is my config:

    from langchain.embeddings import OllamaEmbeddings
    from llama_index.llms.ollama import Ollama

    llm = Ollama(model="llama2:13b")
    
    ...
    
    service_context = ServiceContext.from_defaults(
    
        llm=llm,
    
        embed_model=OllamaEmbeddings(model="llama2:13b"),
    )

With OpenAI it takes minutes.

Originally created by @lorenzoromani1983 on GitHub (Dec 25, 2023). Original GitHub issue: https://github.com/ollama/ollama/issues/1705 I am trying to generate embeddings with the OllamaEmbeddings class but it takes forever on a Mac M2 Pro I am embedding 22000 posts from a forum's threads; this is my config: from langchain.embeddings import OllamaEmbeddings from llama_index.llms.ollama import Ollama llm = Ollama(model="llama2:13b") ... service_context = ServiceContext.from_defaults( llm=llm, embed_model=OllamaEmbeddings(model="llama2:13b"), ) With OpenAI it takes minutes.
Author
Owner

@jmorganca commented on GitHub (May 10, 2024):

Hi there, new smaller embedding models are now available such as https://ollama.com/library/nomic-embed-text - this should be much faster now, and work is being done for batch embeddings

<!-- gh-comment-id:2103641270 --> @jmorganca commented on GitHub (May 10, 2024): Hi there, new smaller embedding models are now available such as https://ollama.com/library/nomic-embed-text - this should be much faster now, and work is being done for batch embeddings
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#47475