A local language model keeps workspace chats on the Docker host. AnythingLLM's built-in LLM runs a downloaded model inside the application container, allowing workspace chat without a separate inference service or an API key.

The built-in engine is available in AnythingLLM Docker 1.19.0 and is disabled by default. It must be enabled in the container's startup environment; editing the application's persisted environment file or changing a provider in the web interface cannot start it. An existing installation keeps its current provider until another provider is selected.

Model downloads need internet access, disk space, and enough memory for inference alongside AnythingLLM. A small quantized model is a suitable starting point for CPU chat. The engine and downloaded models remain in AnythingLLM's persistent storage when the container is recreated with the same mounts.

This CPU-only method starts with an existing AnythingLLM 1.19.0 container named anythingllm, a completed initial setup, and an existing workspace. The storage layout matches the official Docker installation, including its separately mounted .env file. An older installation needs an upgrade before this feature is available.
Related: AnythingLLM Docker installation
Related: Built-in LLM requirements
Related: How to view Docker logs for AnythingLLM

Steps to enable the built-in LLM in AnythingLLM Docker:

  1. Set the path to your existing AnythingLLM storage directory.
    $ export STORAGE_LOCATION="$HOME/anythingllm"

    The path must be the storage already mounted by your current container, not a new directory. The remaining commands use this shell and the same storage and environment-file mounts. Custom installations need their original ports, mounts, and other required options retained in the replacement container.

  2. Stop the existing AnythingLLM container.

    Chat is unavailable until the replacement starts. The stopped storage backup and renamed original container provide a recovery point; containers must never run concurrently against the same storage. The backup may contain documents and provider credentials.

    $ docker stop anythingllm
    anythingllm
  3. Create a private parent directory for the stopped storage backup.

    The backup can contain provider credentials and documents. A mode-700 parent prevents other non-root local users from reading the copy even when the source permissions are more open.

    $ mkdir -m 700 "$HOME/anythingllm-before-built-in"

    The parent must not already exist; mkdir stops with an error if that name is in use. The disk needs room for the complete storage copy.

  4. Copy the stopped instance's complete storage directory beneath the private parent.
    $ sudo cp -a "$STORAGE_LOCATION" "$HOME/anythingllm-before-built-in/storage"

    The -a option preserves file ownership and modes, including the hidden .env file, while the private parent protects the backup. The image runs as UID/GID 1000:1000, so sudo may be needed to copy its files.

  5. Rename the stopped container to retain its original startup configuration.
    $ docker rename anythingllm anythingllm-before-built-in

    The name anythingllm-before-built-in must be unused. The original container remains stopped while the replacement uses its storage.

  6. Recreate AnythingLLM with the built-in LLM startup flag and the original storage mounts.

    -p 3001:3001 publishes the web application on every Docker-host interface. Only a trusted network with suitable access restrictions is appropriate; internet access requires authentication and HTTPS configured separately.

    $ docker run -d \
      --name anythingllm \
      --cpus 2 --memory 4g \
      -p 3001:3001 \
      -v "$STORAGE_LOCATION:/app/server/storage" \
      -v "$STORAGE_LOCATION/.env:/app/server/.env" \
      -e STORAGE_DIR="/app/server/storage" \
      -e ENABLE_BUILT_IN_LLM=true \
      mintplexlabs/anythingllm:1.19.0

    Docker prints the new container ID. The two-CPU and 4 GiB limits suit the small model used here; larger models need more resources. ENABLE_BUILT_IN_LLM=true must be passed to docker run, even when an application .env file is mounted. The engine downloads on first startup and listens only inside the container. Basic CPU chat needs no GPU passthrough or extra Docker capabilities.

    If the replacement cannot start, recovery can use the retained original container after the replacement has been stopped and removed. Its name is anythingllm-before-built-in. A clean reversal of provider changes also needs the stopped backup restored while both containers are stopped; the original container alone still mounts the modified storage.
    Related: How to view Docker logs for AnythingLLM

  7. Open AnythingLLM's instance settings with the wrench icon at the bottom left.

    The application remains at its usual web address. Startup may take longer while the engine downloads.

  8. Expand AI Providers in the settings sidebar.
  9. Open LLM under AI Providers.
  10. Open the LLM Provider selector.

    An existing provider may appear here instead of None selected.

  11. Select Built-in from the provider list.

    If Built-in is missing, the running container was not started with the enabling flag or uses an older image. A restart of the original container does not add a new startup variable.

  12. Click Pull model from Hugging Face.
  13. Enter the small model's repository and quantization in the repository field.
    unsloth/Qwen3-0.6B-GGUF:Q4_K_M

    This public GGUF download is about 410 MiB. Runtime memory use is larger than the model file, and the context window adds to it.

  14. Click Pull to download the specified model.

    A progress indicator replaces the input while the model is transferred. Completion adds Qwen3-0.6B to Downloaded Models and marks it Active.

  15. Expand Show Advanced Settings after the downloaded model appears as Active.
  16. Set Model context window to 2048.

    This smaller context bounds memory use for the CPU example. A larger conversation or document workload may need a larger context and more memory.

  17. Click Save changes to apply the built-in provider settings.
  18. Return to the chat interface with Back to workspaces at the bottom left.
  19. Open the model selector at the top of your workspace chat.

    The selected model's name appears here; a workspace with another provider can show a different name. The Guide workspace name in the pictures represents your existing workspace.

  20. Select Built-in in the workspace model picker.
  21. Choose Qwen3-0.6B from Available Models for Built-in.
  22. Click Use this model to apply the workspace selection.
  23. Open the brain-shaped Reasoning Effort control beside Tools.
  24. Select Off for the short CPU chat test.
  25. Enter the arithmetic prompt in the message field.
    What is 2 plus 3? Reply with one short sentence.
  26. Send the prompt with the upward arrow in the message field.

    The first request also downloads the inference runtime and loads the model. A loading message is expected before the answer appears.

  27. Verify that the workspace returns a complete answer from the selected local model. Example output:
    2 plus 3 is 5.

    Wording can vary. A provider error, unfinished generation, or model-loading message without an answer does not complete the check. The existing workspace and running container remain available for further chat.

Share this guide