> For AI agents: the complete documentation index is available at /Prism/llms.txt, the full documentation bundle is available at /Prism/llms-full.txt.

# FAQ & Troubleshooting

Use this reference to quickly diagnose and resolve common configuration or runtime issues inside Zotero Prism.

## Local LLMs (Ollama, LM Studio, vLLM)

### How do I connect a local Ollama or LM Studio model?

1. Start **Ollama** (`ollama serve`, default `http://localhost:11434/v1`) or **LM Studio's Local Server** (`http://localhost:1234/v1`).
2. Pull at least one model (for example `ollama pull qwen3:14b`).
3. Open **Prism Settings → API Providers → Add Provider Profile → Others**, pick the **Ollama (Local)** or **LM Studio (Local)** template (which automatically checks **`No API key required (e.g., local Ollama / LM Studio)`** inside **`▸ Advanced options`**), and click **Fetch Models**.
4. Select your model and click **Save**.

### Local server refuses connection or `Fetch Models` is empty

- Confirm the Base URL ends in **`/v1`** for chat completions (e.g., `http://localhost:11434/v1`, `http://localhost:1234/v1`, or `http://localhost:8000/v1` for vLLM). _(Note: Ollama embeddings also work with a bare `http://localhost:11434` URL via `/api/embed`.)_
- Under **`▸ Advanced options`**, verify **`No API key required (e.g., local Ollama / LM Studio)`** is **checked** if your local server has no auth token.
- Verify the server is running and at least one model is downloaded (`ollama list`). If a custom local server doesn't expose `/models`, add the exact model ID manually using inline **`+ Add model`**.
- Because Prism sends requests through Zotero's privileged host runtime rather than an unprivileged browser page, standard browser CORS errors do not block Ollama—if you still see a connection refusal, check local firewalls or Zotero's proxy settings (`bypass localhost`). Local streams also have idle timeouts disabled so slow local reasoning never times out.

## API & Model Errors

| Error / Symptom                               | Cause                                                                    | Exact Fix                                                                                                                                         |
| --------------------------------------------- | ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`401` / `403` Authentication Error**        | Missing, revoked, or mistyped API key                                    | Click **`Check Provider Settings`** on the error banner and re-paste your API key                                                                 |
| **`429` Rate Limit**                          | Provider quota or requests-per-minute cap reached                        | Wait for the parsed `Retry-After` window and click **`Retry Request`**, or switch to a **Fast / Cheap** model                                     |
| **`404` Model or Endpoint Not Found**         | Deprecated model ID or incorrect custom Base URL                         | Click **`Check Provider Settings`**, verify the Base URL (`/v1`), and click **`Fetch Models`** again                                              |
| **`unsupported_modality`**                    | Active model does not accept image input (e.g., cropped figure attached) | Assign a vision model in **Settings → Model Routing → Vision / Multimodal** and enable **Automatic model selection in chat**, or remove the image |
| **`unsupported_reasoning`**                   | Gateway or model rejects the selected Reasoning Effort parameter         | Set **Reasoning Effort** to **`Off`** in the sidebar footer, or adjust **Custom Reasoning** under **Others** provider settings                    |
| **Stalled Cloud Stream (`180s` timeout)**     | Upstream cloud SSE connection stopped emitting bytes                     | Click **`Retry Request`**; if persistent, check network stability or switch models via the sidebar Quick Model Switcher                           |
| **Offline Banner (`NS_ERROR_OFFLINE` / DNS)** | Zotero or device has no internet connection                              | Click **`Use {localProvider}`** or **`Add Local LLM`** on the top banner to continue offline with Ollama / LM Studio                              |

### Context Window Limit Exceeded (`context_length` / "too many tokens")

1. Click **`Compact Context Now`** directly on the error banner (or **`Compact`** inside the Context Bar token meter).
2. Confirm **`Auto-compact long conversations`** _(triggers automatically at `82%`)_ and **`Automatic model selection in chat`** are enabled in **Settings → General Settings** / **Model Routing**.
3. When comparing many long PDFs, consider using the standalone **Research Extraction Matrix** (extracts paper-by-paper cleanly) or attaching only the most relevant papers via `@` mentions.

## PDFs, Citations & Better BibTeX

### Citation jumps say `Page fallback` or can't highlight text on a scanned PDF

Prism's highlighter runs a **4-pass text matcher** (exact/compound-hyphen, spaceless kerning-split, ellipsis-split sub-segments, and sliding-window word-overlap fuzzy match for minor OCR glitches), but **image-only scanned PDFs** have no embedded text layer and fall back to page-level anchors (labeled **`Page fallback`** in Approval Cards).

- **Best fixes:**
  1. Use a **Native PDF** provider (**Claude**, **OpenAI**, **Gemini**, or a **Claude-Style Proxy**) so the model reads the page visuals directly.
  2. Configure a **Vision** model under **Model Routing** so Prism's `view_paper_pages` tool can inspect scanned pages as images.
  3. Use **Crop-to-Chat** (draw an area box in Zotero Reader → **`Ask Prism`** / **`Explain figure/table`**, or click the composer's **`Capture current PDF page`** button) for specific charts or formulas.

### Better BibTeX citekeys aren't appearing in LaTeX / Obsidian / BibTeX copy

Prism checks citation keys in order: **Better BibTeX** (`KeyManager`) → **Zotero 8+ native `citationKey`** → **`Extra` (`Citation Key: ...`)** → deterministic fallback (`AuthorYearWord`).

- Verify **Better BibTeX** is installed, enabled, and has finished indexing (especially after switching into a Group Library).
- Or pin a manual key in Zotero's `Citation Key` field or `Extra` (`Citation Key: smith2025prism`). Prism's `/tidy-up` skill explicitly preserves `Citation Key:` and `tex.*` lines in `Extra`.

## Semantic Index, Privacy & Multi-Device Setup

### Semantic Search isn't finding newly imported papers or returns lexical-only results

1. Open **Prism Settings → Semantic Index** and check that an **Embedding** model is assigned in **Model Routing → Embedding**.
2. Click **`Build / Update Tier 1 Index`** (or **`Full Rebuild`** after large batch imports).
3. For deep body-text recall inside PDFs, click **`Index Current PDF`**, **`Index Collection`**, or enable **`Automatically index PDF body (Tier 2) in the background when opened`**.
4. If your embedding endpoint is temporarily unreachable, Prism falls back cleanly to **lexical-only** search over existing local chunks.

### Privacy Guardrail blocked my request

When **`Block cloud transmission for protected items`** is enabled, Prism fails closed whenever a paper matches a protected tag, a protected collection (including nested subcollections), or has unverifiable metadata (`metadata_ambiguous`) while targeting a non-local model.

- Click **`Switch to {localProvider} & Retry`** directly on the inline banner to continue privately on Ollama / LM Studio.
- Note that Privacy Guardrail allows **strictly loopback & `.local` hosts** (`localhost`, `127.x.x.x`, `::1`, `0.0.0.0`, `*.local`, `*.localhost`) and blocks remote LAN IPs.

### Why do I have to re-enter API keys on a second computer?

By design, Prism stores API keys, MCP bearer tokens, and BYOK search keys exclusively in your OS-encrypted **Zotero Login Manager** and **never syncs or exports secrets**. On a second device, import your **Secret-Free Settings Backup (`Import Settings (JSON)…`)** and re-enter your keys once locally.

## Updates & MCP Troubleshooting

### Check for Updates or In-App Install fails

- Verify your machine can reach `github.com` (check Zotero proxy settings if on an institutional network).
- Prism verifies every download against an official HTTPS GitHub `.xpi` URL and a 128-character **`sha512:`** digest before installing.
- If an AI response is streaming, wait for it to complete or click **`Install Anyway`**. You can always install manually via **`View Release Notes`** or **`Open Zotero Add-ons Manager`**.

### Inbound Local MCP Server returns HTTP `403` or connection refused

1. Open **Prism Settings → MCP & Web** and confirm **Inbound Local MCP Server** is not set to **`Disabled (Default)`** (`Read-Only`, `Additive (+ Create Note)`, or `Ask-for-Approval`).
2. Confirm your MCP client points to **`http://127.0.0.1:23119/prism/mcp`** (matching Zotero's active HTTP port).
3. HTTP **`403`** means a non-loopback host or non-loopback `Origin` header was sent—only local loopback clients (`127.0.0.1`, `::1`, `localhost`) are permitted.

### External MCP Server times out or loses session

- **Streamable HTTP / SSE:** Prism automatically re-initializes stale sessions once and retries (`20s` timeout). If the server added or renamed tools, click **`Test & Sync Tools`** in **Settings → MCP & Web**.
- **Local Stdio Subprocess:** If a local CLI server times out after `20s` or Gecko's `Subprocess.sys.mjs` cannot spawn it in your environment, inspect the returned `stderr` message or run the server over **Streamable HTTP / SSE**.

## Still Stuck?

Send us a message directly via the [Feedback](/Prism/guide/feedback.md) page here in the docs, open **Prism Settings → Feedback** inside Zotero (with anonymous environment info attached), or file a report on [GitHub Issues](https://github.com/lemingshen/Prism/issues).
