diff --git a/docs/embeddings/configuration/vectors.md b/docs/embeddings/configuration/vectors.md index 0c214bc7c..a77908efb 100644 --- a/docs/embeddings/configuration/vectors.md +++ b/docs/embeddings/configuration/vectors.md @@ -43,6 +43,19 @@ Builds embeddings using a [llama.cpp](https://github.com/abetlen/llama-cpp-pytho Builds embeddings using a LiteLLM model. See the [LiteLLM documentation](https://litellm.vercel.app/docs/providers) for the options available with LiteLLM models. +Options for the underlying API call, such as the base URL of an OpenAI-compatible endpoint, are set with [vectors](#vectors). + +```yaml +path: openai/text-embedding-3-large +method: litellm +vectors: + api_base: https://api.aimlapi.com/v1 +``` + +The example above runs [aimlapi.com](https://aimlapi.com) embeddings and reads the key from `OPENAI_API_KEY`. Note that the `aiml/` model prefix used by the [LLM](../../../pipeline/llm/llm) pipeline is a chat-completions route only — LiteLLM raises `Unmapped LLM provider for this endpoint` when it's used with embeddings, so the OpenAI-compatible route above is required. + +Setting `api_key` in `vectors` also works but isn't recommended. The `vectors` configuration is stored in the index configuration, so [saving](../../methods/#txtai.embeddings.Embeddings.save) an index would write the key to disk in plain text. + ### model2vec Builds embeddings using a [Model2Vec](https://github.com/MinishLab/model2vec) model. Model2Vec is a knowledge-distilled version of a transformers model with static vectors. diff --git a/docs/pipeline/llm/llm.md b/docs/pipeline/llm/llm.md index 72b6044e1..d0661891c 100644 --- a/docs/pipeline/llm/llm.md +++ b/docs/pipeline/llm/llm.md @@ -70,6 +70,8 @@ The LLM pipeline automatically detects the underlying LLM framework. This can al See the [LiteLLM documentation](https://litellm.vercel.app/docs/providers) for the options available with LiteLLM models. +Each LLM API reads its key from its own environment variable. For example, [aimlapi.com](https://aimlapi.com) models are prefixed with `aiml/` and read `AIML_API_KEY`. + See the [OpenCode documentation](https://opencode.ai/docs/server/) for more on how to integrate the LLM pipeline with a running OpenCode instance. ```python @@ -104,6 +106,7 @@ llm = LLM("ollama/gpt-oss", api_base="http://localhost:11434") llm = LLM("openai/gpt-oss", api_base="http://localhost:4000") # LLM APIs - must also set API key via environment variable +llm = LLM("aiml/openai/gpt-5-5") llm = LLM("gpt-5.2") llm = LLM("claude-opus-4-5-20251101") llm = LLM("gemini/gemini-3-pro-preview")