Semestra

AI and BYOK

Semestra's AI features run on providers you bring. How keys are stored and which model is used.

Sem (the assistant), syllabus and timetable extraction, image reading and file search all call an AI provider that you configure: bring your own key (BYOK). Semestra does not resell model access, so there is no AI quota and no AI bill from Semestra; your provider bills you directly.

Where to configure it

Global settings, under AI:

PageWhat it holds
ProvidersYour providers: type, name, base URL, key, and what the endpoint can do
ModelsWhich model serves each purpose, and optional model parameters
UsageTokens used and their estimated cost

How keys are stored

  • Keys are encrypted with the server's SEMESTRA_ENCRYPTION_KEY before they are written to the database. The API only ever returns a masked hint.
  • A provider is test-called before it is saved, and again when its key changes.
  • Data exports never include keys. After importing a backup, providers that had a key are turned off until you enter it again.

Purposes

Each AI call has a purpose, and each purpose needs one capability from the provider.

PurposeUsed forNeeds
SemConversations with the assistant, and compacting themchat
Reading documentsCourse details, deadlines and grades from syllabichat
Reading imagesTimetable screenshotsvision
OCRText in scanned PDFs and photos of pagesvision
SearchFinding passages in your course filesembedding
Light tasksConversation titles, suggested questions, tidying Sem's memorychat

File indexing

New course files are read and indexed as soon as they are added, which is when scanned pages go to the image model and passages to the search model. To control that spending, turn off File indexing → Index new files automatically in the program's (or a course's) settings. Files added while it is off are indexed when you ask for it, or when an import needs them.

Search vectors belong to the model that made them, so changing the search model rebuilds them for every indexed file in the background. When files already have vectors, the settings ask before switching.

Which model answers

For each purpose, Semestra takes the first of:

  1. The model you chose for that purpose on Models, if its provider is on and can serve it.
  2. Any enabled provider that can serve it, with that provider type's recommended model.
  3. On a self-hosted instance, the instance-wide provider.

When none applies, the feature shows a quiet "connect AI" hint instead of failing.

Recommended models (used in step 2):

ProviderSem, documents, imagesLight tasksSearch
Anthropicclaude-sonnet-5-5claude-haiku-5-5(none)
OpenAIgpt-5; gpt-5-mini for documents and imagesgpt-5-nanotext-embedding-3-small
Geminigemini-2.5-pro; gemini-2.5-flash for documents and imagesgemini-2.5-flash-litegemini-embedding-001
Ollamaqwen3:8b (no images)qwen3:8bnomic-embed-text

OCR uses the light-task model (Ollama has none). A self-hosted server can read scanned pages itself instead, with no model at all: see Local OCR. It can also embed text for search itself: see Local embedding.

Compatible endpoints have no recommendation: pick a model on Models, or type its name when the endpoint cannot list its models.

Cost estimates

The Usage page estimates cost with the genai-prices price list bundled with the server. Compatible endpoints are matched by their base URL (DeepSeek, OpenRouter and others); models with no known price show no cost, and Ollama is always free.