> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cognee.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Local Setup (No API Key)

> Run Cognee entirely on your own machine using Ollama and Fastembed — no cloud API key required

Run Cognee entirely on your own machine — no cloud API key required. The key rule is that **both** the LLM provider **and** the embedding provider must be configured together to use a local backend; configuring only one will cause the other to fall back to OpenAI.

**Before you start:**

* Complete [Quickstart](/getting-started/quickstart) to understand basic operations
* Install [Ollama](https://ollama.ai) if using the Ollama options below

<Info>
  After switching to a local provider for the first time, call `cognee.prune.prune_system(metadata=True)` before running `cognify` to ensure there are no stale vector collections from the previous (OpenAI) embedding dimensions.
</Info>

<Tabs>
  <Tab title="Ollama (LLM + Embeddings)">
    Fully local setup using [Ollama](https://ollama.ai) for both text generation and embeddings.

    **Prerequisites**: Install Ollama and pull the required models:

    ```bash theme={null}
    ollama pull llama3.1:8b
    ollama pull nomic-embed-text:latest
    ```

    **.env configuration:**

    ```dotenv theme={null}
    # LLM — Ollama
    LLM_PROVIDER="ollama"
    LLM_MODEL="llama3.1:8b"
    LLM_ENDPOINT="http://localhost:11434/v1"
    LLM_API_KEY="ollama"

    # Embeddings — Ollama
    EMBEDDING_PROVIDER="ollama"
    EMBEDDING_MODEL="nomic-embed-text:latest"
    EMBEDDING_ENDPOINT="http://localhost:11434/api/embed"
    EMBEDDING_DIMENSIONS="768"
    HUGGINGFACE_TOKENIZER="nomic-ai/nomic-embed-text-v1.5"
    ```

    `LLM_API_KEY="ollama"` is a placeholder required by the client library — Ollama itself does not validate it.
    `HUGGINGFACE_TOKENIZER` is the HuggingFace repo ID of the tokenizer used for token counting when sending requests to the Ollama embedding endpoint.
  </Tab>

  <Tab title="Ollama LLM + Fastembed">
    Uses [Ollama](https://ollama.ai) for text generation and [Fastembed](https://github.com/qdrant/fastembed) for CPU-friendly local embeddings (no Ollama embedding model required).

    **Prerequisites**: Install Ollama and pull the LLM model:

    ```bash theme={null}
    ollama pull llama3.1:8b
    ```

    Fastembed is bundled with Cognee — no separate install needed.

    **.env configuration:**

    ```dotenv theme={null}
    # LLM — Ollama
    LLM_PROVIDER="ollama"
    LLM_MODEL="llama3.1:8b"
    LLM_ENDPOINT="http://localhost:11434/v1"
    LLM_API_KEY="ollama"

    # Embeddings — Fastembed (CPU, no API key)
    EMBEDDING_PROVIDER="fastembed"
    EMBEDDING_MODEL="sentence-transformers/all-MiniLM-L6-v2"
    EMBEDDING_DIMENSIONS="384"
    ```
  </Tab>
</Tabs>

<Columns cols={3}>
  <Card title="LLM Providers" icon="brain" href="/setup-configuration/llm-providers">
    Configure OpenAI, Azure, Gemini, Anthropic, Ollama, or custom LLM providers
  </Card>

  <Card title="Embedding Providers" icon="layers" href="/setup-configuration/embedding-providers">
    Set up OpenAI, Mistral, Ollama, Fastembed, or custom embedding services
  </Card>

  <Card title="Setup Configuration" icon="settings" href="/setup-configuration/overview">
    Full configuration reference for all backends
  </Card>
</Columns>
