haive.core.engine.embedding.providers.OllamaEmbeddingConfigΒΆ

Ollama embedding configuration.

ClassesΒΆ

OllamaEmbeddingConfig

Configuration for Ollama embeddings.

Module ContentsΒΆ

class haive.core.engine.embedding.providers.OllamaEmbeddingConfig.OllamaEmbeddingConfig[source]ΒΆ

Bases: haive.core.engine.embedding.base.BaseEmbeddingConfig

Configuration for Ollama embeddings.

This configuration provides access to locally hosted Ollama embedding models including nomic-embed-text, mxbai-embed-large, and other supported models.

Examples

Basic usage:

config = OllamaEmbeddingConfig(
    name="ollama_embeddings",
    model="nomic-embed-text",
    base_url="http://localhost:11434"
)

embeddings = config.instantiate()

With custom headers:

config = OllamaEmbeddingConfig(
    name="ollama_embeddings",
    model="mxbai-embed-large",
    base_url="http://localhost:11434",
    headers={"Authorization": "Bearer token"}
)

With custom options:

config = OllamaEmbeddingConfig(
    name="ollama_embeddings",
    model="nomic-embed-text",
    base_url="http://localhost:11434",
    model_options={"temperature": 0.1}
)
embedding_typeΒΆ

Always EmbeddingType.OLLAMA

modelΒΆ

Ollama model name (e.g., β€œnomic-embed-text”)

base_urlΒΆ

Ollama server URL

headersΒΆ

Optional HTTP headers for requests

model_optionsΒΆ

Optional model-specific options

get_default_model()[source]ΒΆ

Get the default model for Ollama embeddings.

Return type:

str

get_model_info()[source]ΒΆ

Get information about the configured model.

Return type:

dict

get_supported_models()[source]ΒΆ

Get list of popular Ollama embedding models.

Return type:

list[str]

instantiate()[source]ΒΆ

Create an Ollama embeddings instance.

Returns:

OllamaEmbeddings instance configured with the provided parameters

Raises:
Return type:

Any

list_available_models()[source]ΒΆ

List models available on the Ollama server.

Returns:

List of model names available on the server

Return type:

list[str]

test_connection()[source]ΒΆ

Test connection to Ollama server.

Returns:

True if connection is successful, False otherwise

Return type:

bool

classmethod validate_base_url(v)[source]ΒΆ

Validate Ollama server URL.

Return type:

Any

validate_configuration()[source]ΒΆ

Validate the configuration before instantiation.

Return type:

None

classmethod validate_model(v)[source]ΒΆ

Validate the Ollama model name.

Return type:

Any