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

# App Setup

> Configure providers and foundation services

HQ uses foundation services to power different capabilities. Configure them in the **Provider Configuration** panel on the [home screen](https://open-politics.org/hq).

## Foundation Services

<CardGroup cols={2}>
  <Card title="Language Models" icon="brain">
    Chat, classification, structured extraction. The core AI capability.
  </Card>

  <Card title="Embeddings" icon="vector-square">
    Vector search, similarity matching, semantic discovery within infospaces.
  </Card>

  <Card title="Web Search" icon="globe">
    Live web results for chat - ground responses in current information.
  </Card>

  <Card title="Geocoding" icon="location-dot">
    Extract and map locations from your documents. Powers geographic visualizations.
  </Card>
</CardGroup>

<img className="hidden dark:block" src="https://mintcdn.com/openpolitics/Y-lddUWNKzzzglmy/images/home-config-dark.png?fit=max&auto=format&n=Y-lddUWNKzzzglmy&q=85&s=6ef20c3854e5f82be9b8def1b746bedf" alt="App Setup" width="100%" data-path="images/home-config-dark.png" />

<img className="block dark:hidden" src="https://mintcdn.com/openpolitics/Y-lddUWNKzzzglmy/images/home-config-light.png?fit=max&auto=format&n=Y-lddUWNKzzzglmy&q=85&s=56e574dcb312f30f25b185921894c238" alt="App Setup" width="100%" data-path="images/home-config-light.png" />

Each service type supports multiple providers. Pick what fits your needs — cloud APIs, local inference, or a mix.

***

## API Key Storage

Two storage modes for each provider:

| Mode               | What it does               | Use when                                         |
| ------------------ | -------------------------- | ------------------------------------------------ |
| **Runtime Only**   | Keys stay in your browser  | Quick testing, interactive use                   |
| **Save for Tasks** | Keys encrypted in database | Background jobs, large analysis runs, automation |

<Warning>
  **Background tasks require saved keys.** The Celery worker that processes large analysis runs can't access your browser. If jobs hang or fail, check that you've saved keys to the backend.
</Warning>

***

## Providers

### Language Models

| Provider  | Get Key                                                |
| --------- | ------------------------------------------------------ |
| Anthropic | [console.anthropic.com](https://console.anthropic.com) |
| OpenAI    | [platform.openai.com](https://platform.openai.com)     |
| Google    | [aistudio.google.com](https://aistudio.google.com)     |
| Ollama    | Local — no key needed                                  |

### Ollama

Ollama is a local language model server that has many models available and is a great way to get started with local inference.

<Steps>
  <Step title="Select Ollama as LLM and Embedding Provider">
    <img className="hidden dark:block" src="https://mintcdn.com/openpolitics/Y-lddUWNKzzzglmy/images/ollama-select-dark.png?fit=max&auto=format&n=Y-lddUWNKzzzglmy&q=85&s=a218435ad8d5016bff87a4c1df8894d0" alt="Ollama" width="100%" data-path="images/ollama-select-dark.png" />

    <img className="block dark:hidden" src="https://mintcdn.com/openpolitics/Y-lddUWNKzzzglmy/images/ollama-select-light.png?fit=max&auto=format&n=Y-lddUWNKzzzglmy&q=85&s=3e7fb23689f41fc226fdad2bfdead68c" alt="Ollama" width="100%" data-path="images/ollama-select-light.png" />
  </Step>

  <Step title="Select a model">
    <img className="hidden dark:block" src="https://mintcdn.com/openpolitics/Y-lddUWNKzzzglmy/images/ollama-model-menu-dark.png?fit=max&auto=format&n=Y-lddUWNKzzzglmy&q=85&s=383e427b0f9cfa448b64fa587105d1ff" alt="Ollama" width="100%" data-path="images/ollama-model-menu-dark.png" />

    <img className="block dark:hidden" src="https://mintcdn.com/openpolitics/Y-lddUWNKzzzglmy/images/ollama-model-menu-light.png?fit=max&auto=format&n=Y-lddUWNKzzzglmy&q=85&s=ed1869349f5b5a237b459a1c081cd2c2" alt="Ollama" width="100%" data-path="images/ollama-model-menu-light.png" />
  </Step>
</Steps>

### Embeddings

Used for vectorizing content in your infospaces. Configure separately from language models.

| Provider | Notes                              |
| -------- | ---------------------------------- |
| OpenAI   | Reliable, widely used              |
| Ollama   | Local embeddings, complete privacy |

### Web Search

Enables the chat to pull in live search results.

| Provider | Get Key                             |
| -------- | ----------------------------------- |
| Tavily   | [tavily.com](https://tavily.com)    |
| SearXNG  | (soon back integrated in the stack) |

### Geocoding

Location extraction uses Nominatim. Self-hosted deployments include it by default. No API key needed for local Nominatim.

***

## Verifying Setup

1. Open **Chat** and send a message — confirms language model works
2. Upload an asset and check if it is ingested properly
3. Ask chat to search the web — confirms web search
4. Run an analysis with location fields — confirms geocoding

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Infospaces" icon="folder" href="/pages/app/infospaces">
    Create workspaces for your projects
  </Card>

  <Card title="Schemas" icon="microscope" href="/pages/app/schemas">
    Define what to extract from documents
  </Card>
</CardGroup>
