Skip to content

Problem with OllamaEmbedding: "init: embeddings required but some input tokens were not marked as outputs -> overriding" #427

@Powerkrieger

Description

@Powerkrieger

When running a custom pipeline with a FixedSizeSplitter and a TextChunkEmbedder using OllamaEmbeddings I get weird warnings in the Ollama logs:

Okt 07 15:44:57 mylab ollama[397923]: [GIN] 2025/10/07 - 15:44:57 | 200 |   35.791593ms |  <MY_IP>  | POST     "/api/embed"
Okt 07 15:44:57 mylab ollama[397923]: init: embeddings required but some input tokens were not marked as outputs -> overriding
Okt 07 15:44:57 mylab ollama[397923]: init: embeddings required but some input tokens were not marked as outputs -> overriding
Okt 07 15:44:57 mylab ollama[397923]: [GIN] 2025/10/07 - 15:44:57 | 200 |   35.811343ms |   <MY_IP>  | POST     "/api/embed"
Okt 07 15:44:57 mylab ollama[397923]: init: embeddings required but some input tokens were not marked as outputs -> overriding
Okt 07 15:44:57 mylab ollama[397923]: init: embeddings required but some input tokens were not marked as outputs -> overriding

I get a lot of them but the bottom one is the first log message indicating the embeddings endpoint.

The pipeline I use:

pipe = Pipeline()
# define the components
pipe.add_component(
    FixedSizeSplitter(chunk_size=4000, chunk_overlap=200, approximate=False),
    "splitter",
)
pipe.add_component(TextChunkEmbedder(embedder=embedder), "chunk_embedder")
pipe.add_component(SchemaBuilder(), "schema")
pipe.add_component(
    LLMEntityRelationExtractor(
        llm=llm,
        on_error=OnError.RAISE,
    ),
    "extractor",
)
pipe.add_component(Neo4jWriter(neo4j_driver), "writer")
pipe.add_component(SinglePropertyExactMatchResolver(
   driver=neo4j_driver,
   neo4j_database=NEO4J_DATABASE,
   resolve_property="ID"),
   "resolver")
# define the execution order of component
# and how the output of previous components must be used
pipe.connect("splitter", "chunk_embedder", input_config={"text_chunks": "splitter"})

pipe.connect("schema", "extractor", input_config={"schema": "schema"})
pipe.connect(
    "chunk_embedder", "extractor", input_config={"chunks": "chunk_embedder"}
)
pipe.connect(
    "extractor",
    "writer",
    input_config={"graph": "extractor"},
)
pipe.connect("writer", "resolver", input_config={})
return pipe

When I give shorter documents to the pipeline the messages dont appear like this, making me think its got something to do with the size of the chunk send to the embedder. Can someone guide me in how to set that up efficiently? As mentioned in this issue nbonamy/witsy#425 somewhere else (found via this ollama issue ollama/ollama#12381), there might be a performance problem with this log message.

OS ubuntu24.04; GPU NVIDIA; Version per pyproject.toml neo4j-graphrag[ollama]>=1.7.0, neo4j>=5.28.2
If I can provide more info to get this resolved, please tell me so.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions