Vectors from two different embedding models cannot be compared with each other, so AnythingLLM indexes every workspace document through one system-wide embedding model. An Ollama embedding model such as nomic-embed-text can take the place of the built-in default, so documents are indexed by a model on your own Ollama server.
The change reaches every workspace at once. Saving a different embedding provider or model deletes the stored vectors and removes the embedded documents from all workspaces, while their processed copies stay in the document library. Document questions find nothing until each workspace's documents are embedded again, so the change fits best before documents are added or when the affected workspaces can be rebuilt.
AnythingLLM contacts Ollama from inside its own container, so the Ollama address is that container's name on a Docker network both containers share. The network created when setting Ollama as the chat provider already provides the name. Ollama lists chat and embedding models together, and only a model built for embeddings, pulled in addition to the chat model, suits document indexing.
Steps to set the embedding model in AnythingLLM with Ollama:
- Pull the nomic-embed-text embedding model into the Ollama container.
$ docker exec ollama ollama pull nomic-embed-text pulling manifest pulling 970aa74c0a90: 98% ▕█████████████████ ▏ 269 MB/274 MB 85 MB/s 0s pulling 31df23ea7daa: 100% ▕██████████████████▏ 420 B verifying sha256 digest writing manifest success
Here ollama is the Ollama container's name from its Docker installation. nomic-embed-text turns each text chunk into a 768-number vector and reads up to 2,048 tokens at a time. Another embedding model from the Ollama library can take its place with matching substitutions.
- Click the wrench icon beneath the workspace list.

- Click AI Providers under INSTANCE SETTINGS.

- Click Embedder under AI Providers.

- Click the AnythingLLM Embedder box under Embedding Provider to open the provider list.
AnythingLLM Embedder with all-MiniLM-L6-v2 is the built-in default on a new installation. The provider and model shown here produced the vectors that the change will delete.
- Type
Ollamain Search all embedding providers.
- Select Ollama in the filtered provider list.

- Type
http://ollama:11434into the Ollama Base URL field.
The advanced settings open on their own for a new Ollama connection. AnythingLLM reads the model list from this address after the field loses focus, such as when Tab moves to the next field. Here ollama is the container's name on the shared Docker network, while localhost would point at the AnythingLLM container itself.
- Select nomic-embed-text:latest from Ollama Embedding Model.
The list holds every model on the Ollama server, including chat models such as local-chat:latest, and preselects the first entry. A list that stays at --loading available models-- means AnythingLLM cannot reach the address in Ollama Base URL.
- Change Max embedding chunk length from
8192to2048.
AnythingLLM splits documents into chunks of up to this many characters and passes the same number to Ollama as the context size. A 2,048-character chunk stays well inside the 2,048-token input of nomic-embed-text. Embedding batch size stays at
1, which sends one chunk at a time. - Click Save changes.
Saving a different embedding provider or model deletes the vectors of every embedded document in every workspace and removes those documents from their workspaces. The uploaded files stay in the document library, but document questions return no sources until each workspace's documents are embedded again.
- Click Confirm in the WARNING - This action is irreversible dialog.

- Click the back arrow at the bottom of the settings sidebar.
Embedding preferences saved successfully confirms the change, and Save changes disappears once nothing on the page is left unsaved.
- Click the upload icon beside the workspace name in the sidebar.
Cedar Lantern is the example workspace, and cedar-lantern-dispatch.txt stands for a document it held before the change.
- Click the arrow beside custom-documents in My Documents.
The reset removed the document from the workspace, but its processed copy is still in the library, so it does not need to be uploaded again.
- Mark the checkbox of cedar-lantern-dispatch.txt in the custom-documents list.

- Move the selected document into the workspace with Move to Workspace.

- Click Save and Embed to index the document with nomic-embed-text.
On a narrow window, the workspace list sits below the upload area.
- Press Esc to close the Documents dialog once cedar-lantern-dispatch.txt shows a pin icon.
The pin icon appears when the document has been stored in the workspace again. Every other workspace that held documents before the change needs the same re-embedding.
- Display the latest lines of the AnythingLLM container log.
$ docker logs --tail 20 anythingllm ##### snipped ##### [backend] info: [VectorDB::LanceDb] Adding new vectorized document into namespace cedar-lantern [backend] info: [OllamaEmbedder] initialized with model nomic-embed-text:latest at http://ollama:11434. Batch size: 1, num_ctx: 2048 ##### snipped ##### [backend] info: [OllamaEmbedder] Embedding 1 chunks of text with nomic-embed-text:latest in batches of 1. [backend] info: [OllamaEmbedder] Batch 1/1: Embedded 1 chunks. Total: 1/1 [backend] info: [VectorDB::LanceDb] Inserting vectorized chunks into LanceDB collection. ##### snipped #####
Here anythingllm is the AnythingLLM container's name from its Docker installation. The OllamaEmbedder lines show the document passing through nomic-embed-text:latest at the configured address with the saved chunk and batch settings. A [NativeEmbedder] Initialized line logged by the provider switch is expected. NativeEmbedder reporting Embedded Chunk Group for the document in place of the OllamaEmbedder Embedding 1 chunks line means the built-in embedder is still selected, and Ollama service could not be reached means the Ollama address does not answer.
- Click the gear beside Cedar Lantern in the sidebar.

- Click the Chat Settings tab.

- Click Query under Chat mode.
A new workspace starts in Agent mode, where a chat model with tool support can reply through the agent without searching the workspace's documents. Query mode answers only from document passages it retrieves, so the next reply depends on the new vectors. The choice is saved as soon as it is clicked.
- Click + New Thread under Cedar Lantern to start a conversation without earlier history.

- Type a question that only the re-embedded document can answer into Send a message.
For Cedar Lantern, what is the dispatch code and collection day? Answer only from the supplied documents and cite the source.
- Click the arrow button at the right of the message box.

- Click Sources below the finished reply.

- Confirm that the Sources panel lists cedar-lantern-dispatch.txt for the reply.
The reply's LANTERN-47 dispatch code and Tuesday collection day come from that document, which the workspace can retrieve only through the vectors created by nomic-embed-text. The wording of the reply can vary. A reply of There is no relevant information in this workspace to answer your query with no Sources means the search found no passage, so check that the document shows a pin icon in the workspace's Documents list.