Reading & practice

Reading

Lector supports two content formats:

  • EPUB files: upload directly through the library interface
  • Web articles: paste a URL and Lector extracts the content via Readability

You can also paste raw text directly for quick reading practice.

Click-to-translate

Click any word while reading to see its translation. If you have an ANTHROPIC_API_KEY configured, Lector uses Claude for context-aware translation of uncommon words and phrases. Without an API key, it falls back to a built-in dictionary of the top 2000 words.

Translation quality depends on which AI provider you have configured.

Word states

Every word you encounter is tracked with a state:

  • New: you haven't interacted with this word yet
  • Learning: you've looked it up or saved it
  • Known: you've marked it as known

Words are highlighted in your text based on their state, so you can see at a glance how much of a passage you already know.

Cloze practice

The cloze practice system ships with frequency-ordered sentence banks from Tatoeba for every supported language, so you learn common words first.

Practice modes

  • Multiple choice: pick the correct word from four options
  • Typing: type the missing word (with optional hard mode that disables hints)

SRS scheduling

Sentences are scheduled using spaced repetition with five mastery levels:

MasteryInterval
0%Immediate
25%1 day
50%3 days
75%7 days
100%14 days

LLM providers

Lector uses a large language model for context-aware translations when you click words and phrases. You choose between two providers in Settings → AI Provider: Anthropic (cloud) or Local / self-hosted (any OpenAI-compatible server).

A note on local quality: a capable local model holds up well even on a low-resource language like Afrikaans. In our own testing (Afrikaans → English, chrF++ on Tatoeba), a good ~12B model run through LM Studio matched the cloud models. What matters is picking a general instruction-tuned model (roughly 8B or larger, not a tiny or coder-only model), more than choosing cloud over local.

Anthropic (cloud)

The highest-quality option. Uses Claude for context-aware translation of words, phrases, and grammar explanations.

Lector supports two authentication methods:

  • API key: Get one from console.anthropic.com. Set ANTHROPIC_API_KEY in your environment, or enter it in Settings. Pay-as-you-go billing.
  • OAuth token (Pro/Team plan): Uses your existing Claude Pro or Team subscription credits. Set CLAUDE_CODE_OAUTH_TOKEN in your environment. Note: OAuth connections have slower initial startup times compared to API keys.
  • Best translation quality, especially for less common languages
  • Requires internet access and an Anthropic account

Local / self-hosted (OpenAI-compatible)

Points Lector at any server that speaks the OpenAI chat API: Ollama, LM Studio, vLLM, or a remote OpenAI-compatible endpoint. One config covers them all: an endpoint, an optional API key, and a model name. The text you're translating stays on your hardware (unless you point it at a remote endpoint).

In Settings → AI Provider, choose Local / self-hosted (OpenAI-compatible), then set:

  • Preset (optional) — pick Ollama or LM Studio to autofill the endpoint, or Custom for anything else. It only fills the endpoint; edit it afterwards if you like.
  • Endpoint — the base URL of your server (http://localhost:1234 for LM Studio, http://localhost:11434 for Ollama). Lector appends /v1 itself. The call is made server-side, so localhost works even when Lector is hosted elsewhere, except from inside Docker, where you need a host-reachable address.
  • API Key (optional) — leave empty for a local server. Only needed for reverse-proxied or cloud endpoints. Sent as a Bearer token from the server, never exposed to the browser.
  • Model — click Fetch models to list what the server reports via /v1/models, or type a model id directly.

Use Refresh to confirm a green "Connected" status. For a full walkthrough with LM Studio, including the Docker networking gotcha, see Run translations locally with LM Studio.

Work somewhere with no signal? Offline and remote use covers what runs with the network off, and what you must download first.

AnkiConnect

New to Anki? Start with Getting started with Anki for what it is, how to install it, and how to load your first deck — this section covers wiring up the Lector → Anki integration specifically.

Lector connects directly to AnkiConnect running on your local machine. This lets you push vocabulary cards from Lector straight into Anki Desktop. No proxy server, no cloud sync.

Setup

  1. Install the AnkiConnect add-on in Anki Desktop
  2. In AnkiConnect's config, add your Lector origin to the CORS allowlist:
{
  "webCorsOriginList": ["http://localhost:3000"]
}

If you're accessing Lector via a reverse proxy, add that origin too (e.g. https://lector.home.yourdomain.com).

Note: AnkiConnect runs on localhost:8765 by default. The connection is browser-to-localhost, so Anki Desktop must be running on the same machine as your browser.

Lector add-on for Anki (beta) — two-way sync

The Lector add-on runs inside Anki Desktop and syncs with your Lector server — cloud or self-hosted — using a personal API token from Settings. It differs from AnkiConnect in two ways:

  • It's two-way — words and cloze phrases arrive as Lector and Lector Cloze notes, keyed by a stable id, so pushing again updates the existing card instead of creating a duplicate. When you review in Anki, the grades come back: the word's mastery in Lector updates on the next sync.
  • It works remotely — the add-on talks to the server itself, not through your browser, so Anki doesn't have to be on the same machine. This is how Anki works on Lector Cloud; self-hosters can pick either connection under Settings → Anki Integration.

Install the add-on

The add-on is on AnkiWeb as Lector Sync, add-on code 1098736891. It needs Anki 2.1.50 or later.

  1. In Anki Desktop: Tools → Add-ons → Get Add-ons, enter 1098736891, then restart Anki.
  2. In Lector: Settings → API Tokens, mint a token with the anki scopes.
  3. In Anki: Tools → Add-ons → Lector Sync → Config, set api_url (e.g. https://app.lector.dev, or your self-hosted API origin) and api_token.
  4. Run Tools → Lector: Sync now — it also syncs when your profile opens.

Every release is also attached to GitHub releases as a .ankiaddon file, for Tools → Add-ons → Install from file. If you installed that way before, the AnkiWeb copy disables your hand-installed one, and you can delete it under Tools → Add-ons.

Please report anything odd, such as duplicate notes, deck weirdness, sync errors, on GitHub or Discord, ideally with the sync tooltip text.