# Admin console

For administrators only. Everyone else gets a 403 on these pages. The console is kept apart from the research app: when you are under `/admin` or `/dashboard/models` the sidebar switches to **Overview, Users, All research, Spend, Models, Feedback queue, Scholars, Audit log, System** and **Back to the app**.

## Overview
[/admin](/admin) is the front door: cards for **Users**, **All research**, **Spend**, **Models**, **Feedback queue**, **Scholars**, **Audit log** and **System**. Each card opens one area.

## First-run setup
On a fresh install [/setup](/setup) offers **Create the admin account**; the first account becomes the administrator. You need the one-time **token** printed in the server log, then an **Email or username**, a display **name** and a **password** of at least the minimum length. Once an account exists the page redirects away.

## Users
[/admin/users](/admin/users) ("Accounts") lists everyone who can sign in: **Account**, **Role**, **Status**, **Runs** and **Last sign-in (UTC)**.

### The sign-up switch
The toggle at the top reads "Sign-up is open" or "Sign-up is closed". Click it to open or close registration at runtime, without a restart.

### Manage a user
Click **Manage** on a row. You can:

- **Make admin** or **Make user** (the Access control).
- **Suspend** or **Reactivate** the account.
- **Sign out everywhere**.
- Type a **New password** and save: *the user's sessions are all ended.*
- Type the confirmation under **Delete account**: *the account is removed; their research is kept, unowned.*

Every action is written to the [audit log](#audit-log).

### Create a user
**Create an account**: fill **Email or username**, **Name**, **Temporary password** and **Role**, and submit. Hand the credentials to the person; they should change the password under [Account](/docs/20-getting-started#change-password).

## All research
[/admin/research](/admin/research) ("Research by user") shows every run: **Run**, **Made by**, **Status**, **Question** and **Created (UTC)**. The select filters by owner, or by *Unowned*.

### Start a queued run
On a queued row click **Start now**. *The run starts at once, ahead of its place in the queue, and the owner is emailed.*

### Run tools
On any run page, admins see **Admin tools** with **Restart from scratch** and **Delete run**, for stuck or unwanted runs.

## Spend
[/admin/spend](/admin/spend) ("AI spend"). **This month, everyone** shows the total against the ceiling.

### Limits
- **Default limits**: `userDailyUsd`, `userMonthlyUsd`, `globalMonthlyUsd` and `userMaxConcurrentRuns`; **0 means no limit**. Click **Save defaults**.
- **Per user**: shows **Today**, **Month** and **All time** and lets you override the day limit, the month limit and the runs-at-once for one person; click **Save**.

## Models
[/dashboard/models](/dashboard/models) ("The models behind the research") shows tiles for **Active provider**, **Provider key**, **Model roles** and **Pipeline stages**.

### Providers
**Providers**: pick one in the select and click **Switch provider**. *It is used from the next call.*

### API keys
**API keys** lists **Provider**, **Key in use** (only the last four characters are shown) and a box to **Set or replace** it.

### Who runs what
**Who runs what — the pipeline, stage by stage** lists which role and model each stage uses and its cost tier.

### The seven roles
Cards for **Reasoning, Extraction, Planning, Hypothesis, Adversarial, Architecture** and **Composition**. Click **Change this model**, choose, and **Save model**.

### Model catalogue
**Model catalogue — strengths, weaknesses, cost** lists prices per million tokens and what each model is good at. **Refresh prices** updates them.

### Call settings
**How every call is made** holds the shared call parameters; click **Save call settings**.

## Feedback queue
[/admin/feedback](/admin/feedback) ("Inbox") shows each message as `#id · Category`. Mark it **new**, **reviewed** or **resolved**.

## Scholar review
[/admin/scholars](/admin/scholars) lists **Ālim-e-Deen applications** with status *pending*, *verified* or *rejected*. Open one to read the details and set the status.

## Audit log
[/admin/audit](/admin/audit) ("Admin actions") lists **When**, **Admin**, **Action**, **Account**, **Detail** and **IP**, newest first. It cannot be switched off.

## System
[/admin/system](/admin/system). **Health** shows the version, the database, the corpus, the queue and errors.

### Backups
**Backups** shows the schedule and the last result. **Back up now** makes a database backup immediately.

### Housekeeping
**Housekeeping**: **Clean up now** removes orphaned files and old logs.

### Recent errors
**Recent errors** lists the last server errors.

## Ontology curation
[/ontology/admin](/ontology/admin) has four tabs: **Labeling**, **Proposals**, **Kinds** and **Worker**.

### Labeling
**Run the ontology mapping**: choose **What to map** (all or chosen surahs, a surah, an ayah), type `ALL` to confirm a whole-corpus run, optionally limit to the first N verses, tick **Skip verses that are already labeled** and **One labeler call per word**, pick a model and click **Start mapping**.

### Runs
**Runs** is the history: **#**, **Scope**, **Status**, **Verses**, **Model**, **Started**, with **Stop**, **Resume** and **Delete**. Open one for its cost breakdown and verses.

### Proposals
**Proposed links** and **Proposed nodes** are what the labeler suggested: **Approve**, **Reject**, **Change relation**, and **Merge nodes** for duplicates.

### Kinds
**Concept or entity?** finds concept nodes that are really physical things. Click **Scan concept nodes**, review the **Not only a concept** table and apply.

### Worker
**Worker** is the background curator: **Status** (**Run one pass now**, **Queue a rescan of labeled verses**), **Settings** (jobs per pass, AI calls per minute and its spending ceiling; **Save settings**) and **Recent events**.
