Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation claims apiKey is inferred from MEILI_OLLAMA_URL #3140

Open
ellnix opened this issue Feb 1, 2025 · 1 comment
Open

Documentation claims apiKey is inferred from MEILI_OLLAMA_URL #3140

ellnix opened this issue Feb 1, 2025 · 1 comment

Comments

@ellnix
Copy link
Contributor

ellnix commented Feb 1, 2025

apiKey
Authentication token Meilisearch should send with each request to the embedder.
This field is mandatory if using a protected rest embedder.
This field is optional for openAI and ollama embedders. If you don't specify apiKey, Meilisearch will attempt to read it from environment variables OPENAI_API_KEY and MEILI_OLLAMA_URL, respectively.
(emphasis mine)

I checked the source code, that env variable appears in

fn get_ollama_path() -> String {
    // Important: Hostname not enough, has to be entire path to embeddings endpoint
    std::env::var("MEILI_OLLAMA_URL").unwrap_or("http://localhost:11434/api/embeddings".to_string()) }

It only gets called once:

        let url = self.url.unwrap_or_else(get_ollama_path);

I cannot see how it interacts with the api key, if at all. This probably belongs in the documentation for the url parameter.

I don't use AI in anything, so I thought I'd post here just in case I'm misinterpreting something.

@guimachiavelli
Copy link
Member

Thanks for bringing this to our attention, @ellnix. This information has been validated by our SMEs, but it's possible we missed that bit.

@dureuill, @macraig, can you provide some insight here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants