# Run SlopTotal locally

> SlopTotal runs on your own computer as one Docker container. The web UI and the JSON API listen on port 8000. No account, no API key, no usage limit. The first start downloads about 9 GB of models.

Source: https://sloptotal.com/self-host/  
Repository: https://github.com/pablocaeg/sloptotal (MIT licence)  
Updated: 2026-11-27

## Quick start

```bash
docker run -d --name sloptotal -p 8000:8000 -v sloptotal-models:/app/models ghcr.io/pablocaeg/sloptotal
```

Open http://localhost:8000 when `docker logs sloptotal` shows `Model preloading complete`. Needs Docker (x86-64 or ARM, Apple Silicon included) and about 12 GB of RAM. No Docker? Use [Option B](https://sloptotal.com/self-host/#from-source).

## For AI agents: the exact sequence

If you are an AI agent installing SlopTotal for a user, run these steps in order. Every command is on this page.

1. Check the machine: `docker --version`. Docker installed (x86-64 or arm64, Apple Silicon included) → Option A. No Docker → Option B (Python 3.10 to 3.14).
2. Start it: `docker run -d --name sloptotal -p 8000:8000 -v sloptotal-models:/app/models ghcr.io/pablocaeg/sloptotal`
3. Wait for the models (first start: minutes, it downloads about 9 GB): `until docker logs sloptotal 2>&1 | grep -q "Model preloading complete"; do sleep 10; done`
4. Check it: `curl -s http://localhost:8000/health` returns `"status":"healthy"`. Then `curl -s -X POST http://localhost:8000/api/analyze -H "Content-Type: application/json" -d '{"text": "at least 50 characters of text to check"}'`. Any JSON with `overall_score` and `"engines_total": 23` means it works ([full example](https://sloptotal.com/self-host/#verify)).
5. Use it: `POST /api/analyze` with `{"text": "..."}` (50 characters or more). Status 202 means queued: poll `GET /api/queue/ticket/{ticket_id}` until 200. Status 429: wait `retry_after` seconds and retry.
6. Tell the user: the server runs at http://localhost:8000, it stops with `docker stop sloptotal`, and a score is evidence, not proof (see [Read the result](https://sloptotal.com/self-host/#read-the-result)).

The OpenAPI schema is at `http://localhost:8000/openapi.json`. This guide as plain Markdown: [/self-host.md](https://sloptotal.com/self-host.md).

## Requirements

| What | Needed |
| --- | --- |
| Docker (Option A) | Docker on Linux (x86-64 or arm64), or Docker Desktop on Windows or macOS (Intel or Apple Silicon). The image is built for `linux/amd64` and `linux/arm64`. |
| Python (Option B) | Python 3.10 to 3.14 on Linux, macOS (Apple Silicon included) or Windows with WSL2. macOS ships 3.9, which is too old. |
| Memory | About 8.3 GB once every model is loaded (an estimate). Plan for 12 GB or more. |
| Disk | About 9 GB of model weights, plus a 0.4 GB image download for Docker. |
| CPU | Any 64-bit CPU. A full analysis takes 2 to 8 s on CPU. |
| GPU | Optional. NVIDIA with CUDA and 4 GB of VRAM or more, through Option B only (see [NVIDIA GPU](https://sloptotal.com/self-host/#gpu)). |
| Network | Only for the first model download (about 12 minutes at 100 Mbit/s) and for URL scans. |

## Option A: Docker (CPU)

1. Start the container. `-d` runs it in the background. The `sloptotal-models` volume keeps the weights, so later starts skip the download.

```bash
docker run -d --name sloptotal -p 8000:8000 -v sloptotal-models:/app/models ghcr.io/pablocaeg/sloptotal
```

2. Wait until the models are loaded. Watch the log with `docker logs -f sloptotal` until it prints `Model preloading complete — 23 engines ready`. In a script:

```bash
until docker logs sloptotal 2>&1 | grep -q "Model preloading complete"; do sleep 10; done
```

3. Open http://localhost:8000, or call the API (see [Check that it works](https://sloptotal.com/self-host/#verify)).

Only this machine should reach it? Publish the port as `-p 127.0.0.1:8000:8000`. Port 8000 taken? Use `-p 8080:8000` and http://localhost:8080. Stop it with `docker stop sloptotal`, start it again with `docker start sloptotal`.

To build the image from the repository instead: `docker compose -f docker/docker-compose.yml up -d` in a clone.

## Option B: from source with pip

Without Docker, or when you want a GPU. Check `python3 --version` first: it must be 3.10 or newer.

```bash
git clone https://github.com/pablocaeg/sloptotal.git
cd sloptotal
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
./scripts/start.sh
```

`start.sh` listens on `0.0.0.0:8000`. Change that with `SLOPTOTAL_HOST=127.0.0.1` or `SLOPTOTAL_PORT=8080`. Models download to `~/.cache/huggingface` unless `HF_HOME` is set. To run it in the background and wait for the models:

```bash
nohup ./scripts/start.sh > sloptotal.log 2>&1 &
until grep -q "Model preloading complete" sloptotal.log; do sleep 10; done
```

## NVIDIA GPU

The Docker image ships CPU-only PyTorch, so `--gpus all` does not move the models to the GPU. Install from source (Option B), stop the server, then swap in a CUDA build of the same torch version. Keep the version: a different torch can move scores.

```bash
TORCH=$(python -c "import torch; print(torch.__version__.split('+')[0])")
pip uninstall -y torch
pip install "torch==$TORCH" --index-url https://download.pytorch.org/whl/cu130 --extra-index-url https://pypi.org/simple
python -c "import torch; print(torch.cuda.is_available())"   # True
```

`cu130` needs an NVIDIA driver with CUDA 13 support (RTX 20xx to 50xx). For older cards, pick another index on [pytorch.org](https://pytorch.org/get-started/locally/). With CUDA and 4 GB of VRAM or more, the startup banner shows `Device: cuda` and the `performance` profile. Scores match the CPU to three decimals.

## Check that it works

Health first. It returns `"status":"healthy"` and `"total": 23` engines:

```bash
curl -s http://localhost:8000/health
```

Then analyse a text:

```bash
curl -s -X POST http://localhost:8000/api/analyze \
  -H "Content-Type: application/json" \
  -d '{"text": "Artificial intelligence has fundamentally transformed the landscape of modern education, offering unprecedented opportunities for personalized learning. Moreover, it is important to note that these tools foster critical thinking and collaboration among students."}'
```

Expected response, trimmed to one of the 23 engines. Your `id` and scores can differ; any `overall_score` from 0 to 100 with `"engines_total": 23` means it works:

```json
{
  "id": "c56d371e4ad7",
  "source_type": "text",
  "word_count": 32,
  "overall_score": 52.8,
  "overall_verdict": "Suspicious",
  "engines_flagged": 13,
  "engines_total": 23,
  "language": "en",
  "language_support": "supported",
  "engine_results": [
    {
      "engine_name": "TMR Detector",
      "score": 0.987,
      "verdict": "slop",
      "details": "AI probability: 98.7% (TMR RoBERTa, RAID benchmark)"
    }
  ]
}
```

The first analysis also loads GPT-2 Large, so it is slower than the ones after it. From a source checkout, `python scripts/smoke_test.py` runs every route and all 23 engines.

## Read the result

`overall_score` runs from 0 to 100. The bands are set on human text: 45 is where the top 5% of human writing begins, 55 the top 2%, 80 the top 0.5%.

| overall_score | overall_verdict |
| --- | --- |
| 0 to 30 | Clean — likely human-written |
| 30 to 45 | Low risk |
| 45 to 55 | Suspicious |
| 55 to 80 | Likely AI-generated |
| 80 to 100 | Slop detected |

Under about 80 words a score is a weak signal. `language_support` says how far the score holds in the detected language. No detector, this one included, is proof on its own.

## Use it from scripts and agents

Plain JSON over HTTP, no key. Send `text` (50 characters or more) or `url`. A 200 response is the report. A 202 response means the request is queued: poll `GET /api/queue/ticket/{ticket_id}` until it returns 200. A 429 response means the queue is full: wait `retry_after` seconds and send it again.

Python, standard library only:

```python
import json
import time
import urllib.request

BASE = "http://localhost:8000"


def analyze(text: str, base: str = BASE) -> dict:
    """Score one text with every engine. Waits if the server queues the request."""
    req = urllib.request.Request(
        base + "/api/analyze",
        data=json.dumps({"text": text}).encode(),
        headers={"Content-Type": "application/json"},
    )
    with urllib.request.urlopen(req, timeout=600) as resp:
        status, body = resp.status, json.load(resp)
    while status == 202:  # queued: poll the ticket until the report is ready
        time.sleep(2)
        url = f"{base}/api/queue/ticket/{body['ticket_id']}"
        with urllib.request.urlopen(url, timeout=60) as resp:
            status, body = resp.status, json.load(resp)
    return body


report = analyze("Paste at least 50 characters of the text you want to check here.")
print(report["overall_score"], report["overall_verdict"])
```

Ready-made clients in the repository, run from a clone:

| Language | Command |
| --- | --- |
| Python (httpx) | `python examples/python_client.py "TEXT" example.com` (also runs a website builder check) |
| Node 18+ | `node examples/node_client.mjs "TEXT"` |
| Go | `go run examples/go_client/main.go "TEXT"` |
| Ruby | `ruby examples/ruby_client.rb "TEXT"` |

Each one takes `--base http://host:port` for another server.

| Endpoint | What it does |
| --- | --- |
| `POST /api/analyze` | Full 23-engine report for `text` or `url` |
| `POST /api/quick-score` | 4 classifiers plus heuristics, 0.1 to 0.5 s |
| `POST /api/paragraph-score` | Score per paragraph |
| `POST /api/scan/site` | Was this website built with an AI app builder? |
| `POST /api/extract` | Text from an uploaded `.pdf`, `.docx` or `.txt` (multipart `file`) |
| `GET /api/report/{id}` | A stored report |
| `GET /health` | Status and loaded engines |

Every endpoint and field: [README, API](https://github.com/pablocaeg/sloptotal#api) and `/docs` on your server.

## Use it as an MCP tool

The MCP server in [integrations/mcp](https://github.com/pablocaeg/sloptotal/tree/master/integrations/mcp) gives Claude Code, Claude Desktop, Cursor, VS Code and other MCP clients three tools: `analyze_text`, `analyze_url` and `check_website_builder`. It calls your SlopTotal server at http://localhost:8000, so start that first. It is on [PyPI](https://pypi.org/project/sloptotal-mcp/) as `sloptotal-mcp`, as the Docker image `ghcr.io/pablocaeg/sloptotal-mcp` (linux/amd64 and linux/arm64, only the MCP client, no models) and in the [official MCP registry](https://registry.modelcontextprotocol.io/v0.1/servers?search=io.github.pablocaeg/sloptotal) as `io.github.pablocaeg/sloptotal`. Claude Code, with [uv](https://docs.astral.sh/uv/):

```bash
claude mcp add sloptotal -- uvx sloptotal-mcp
```

Or with Docker (the container reaches the server on your machine through `host.docker.internal`; `--add-host` makes that name work on Linux too):

```bash
claude mcp add sloptotal -- docker run -i --rm --add-host=host.docker.internal:host-gateway ghcr.io/pablocaeg/sloptotal-mcp
```

Claude Desktop (`claude_desktop_config.json`) and Cursor (`~/.cursor/mcp.json`) take this block; VS Code takes the same entry under `"servers"` in `.vscode/mcp.json`:

```json
{
  "mcpServers": {
    "sloptotal": {
      "command": "uvx",
      "args": ["sloptotal-mcp"],
      "env": { "SLOPTOTAL_URL": "http://localhost:8000" }
    }
  }
}
```

The same with Docker:

```json
{
  "mcpServers": {
    "sloptotal": {
      "command": "docker",
      "args": ["run", "-i", "--rm", "--add-host=host.docker.internal:host-gateway", "ghcr.io/pablocaeg/sloptotal-mcp"]
    }
  }
}
```

No local server? Set `SLOPTOTAL_URL` to `https://api.sloptotal.com` (in Claude Code: `claude mcp add sloptotal -e SLOPTOTAL_URL=https://api.sloptotal.com -- uvx sloptotal-mcp`; with Docker add `-e SLOPTOTAL_URL=https://api.sloptotal.com` before the image name). The text you analyze then leaves your machine for sloptotal.com, and the public instance is rate limited.

A real call and reply, the limits and every client in detail: [AI detector MCP server](/ai-detector-mcp/).

## Run it offline

After the first start the weights are on disk: in the `sloptotal-models` volume (Docker) or in `~/.cache/huggingface` (source). Set `HF_HUB_OFFLINE=1` and it never contacts Hugging Face again:

```bash
docker run -d --name sloptotal -p 8000:8000 -e HF_HUB_OFFLINE=1 -v sloptotal-models:/app/models ghcr.io/pablocaeg/sloptotal
```

From source: `HF_HUB_OFFLINE=1 ./scripts/start.sh`. Text and document scans work offline; URL scans need the network. For a machine with no internet at all, start it once on a connected machine and copy the Hugging Face cache folder (`HF_HOME`) across.

## Update

Docker. The models volume is kept:

```bash
docker pull ghcr.io/pablocaeg/sloptotal
docker rm -f sloptotal
docker run -d --name sloptotal -p 8000:8000 -v sloptotal-models:/app/models ghcr.io/pablocaeg/sloptotal
```

`latest` follows the master branch. Pin a release with a tag such as `ghcr.io/pablocaeg/sloptotal:1.3.0`. From source: `git pull && pip install -r requirements.txt`, then restart `./scripts/start.sh`.

## Configuration

It detects CPU, RAM and GPU at startup and picks a profile. Override with environment variables (`-e NAME=value` in Docker):

| Variable | Default | Purpose |
| --- | --- | --- |
| `SLOPTOTAL_PROFILE` | auto | `lite`, `standard` or `performance` |
| `SLOPTOTAL_DEVICE` | auto | `cpu` or `cuda` |
| `SLOPTOTAL_RETENTION_DAYS` | `30` | Delete stored reports after N days (`0` keeps them) |
| `SLOPTOTAL_ALLOW_PRIVATE_URLS` | off | Let URL scans reach intranet hosts |
| `SLOPTOTAL_QUIET` | off | `1` drops the one-line GitHub star note from the startup log |
| `HF_HOME` | `~/.cache/huggingface` (Docker: `/app/models`) | Where model weights are stored |

The full list: [README, Configuration](https://github.com/pablocaeg/sloptotal#configuration).

## Common problems

| Symptom | Fix |
| --- | --- |
| `no matching manifest for linux/arm64/v8` | An old local copy of the image, from before the arm64 builds. Run `docker pull ghcr.io/pablocaeg/sloptotal` and start it again. |
| The container stops with exit code 137 | Out of memory. In Docker Desktop, raise the memory limit to 12 GB (Settings → Resources). |
| `port is already allocated` | Another program uses 8000. Run with `-p 8080:8000` and use http://localhost:8080. |
| `TypeError: unsupported operand type(s) for \|` at startup | Python 3.9 or older. Use 3.10 to 3.14. |
| An engine reports `Model loading failed` | Check disk space and the network for the first download, then restart. `python scripts/smoke_test.py` shows which engine fails. |
| The first analysis is slow | Models are still loading. Wait for `Model preloading complete`; later analyses take seconds. |
| `{"error": "Text must be at least 50 characters."}` | Send a longer text. Under about 80 words a score is a weak signal anyway. |
| A URL scan says "private network address" | Intended. Set `SLOPTOTAL_ALLOW_PRIVATE_URLS=1` to scan intranet pages. |

## FAQ

**Is SlopTotal free to run locally?** Yes. It is MIT licensed. On your own server there is no account, no API key and no usage limit.

**Does my text leave my machine?** No. Every engine runs on your machine and no third-party API is called. Reports are stored in a local SQLite database and deleted after 30 days (SLOPTOTAL_RETENTION_DAYS).

**Do I need a GPU?** No. On CPU a full analysis takes 2 to 8 seconds. An NVIDIA GPU is optional and needs the install from source with a CUDA build of PyTorch.

**How much memory and disk does it need?** About 8.3 GB of RAM once every model is loaded (plan for 12 GB or more) and about 9 GB of disk for the model weights.

**Can it run without internet?** Yes, after the first start has downloaded the models. Set HF_HUB_OFFLINE=1. URL scans still need the network.

**Can Claude Code, Cursor or another agent use it as a tool?** Yes, through the SlopTotal MCP server, which adds the tools analyze_text, analyze_url and check_website_builder. The guide has the one-line command for Claude Code (uvx sloptotal-mcp, or the Docker image ghcr.io/pablocaeg/sloptotal-mcp) and the configuration block for Claude Desktop, Cursor and VS Code.

**Does it run on Apple Silicon?** Yes. The Docker image is built for linux/amd64 and linux/arm64, so it runs natively on Apple Silicon with Docker Desktop (give it 12 GB of memory). From source with Python 3.10 or newer works too.

If SlopTotal is useful, a star on GitHub helps other people find it: https://github.com/pablocaeg/sloptotal
