The inferwall CLI provides commands to run the HTTP API server, scan single inputs for testing, download and manage ML models, and generate API keys for authentication. Every command accepts --help for inline usage information.
inferwall serve
Starts the InferenceWall HTTP API server on port 8000 by default. The server exposes the /v1/scan/input, /v1/scan/output, and /v1/health endpoints.
Configure server behavior entirely through environment variables — see the Environment Variables reference for the full list.
Example
# Start server with defaults (dev mode, no auth)
inferwall serve
# Start with auth enabled (load keys from .env.local first)
source .env.local && inferwall serve
You can also start the server directly with uvicorn: uvicorn inferwall.api.app:app --host 0.0.0.0 --port 8000
inferwall test
inferwall test --input TEXT [--profile PROFILE]
Scans a single text input through the detection pipeline and prints the result to stdout. Use this to verify your installation, test specific payloads, or quickly validate signature behavior without standing up the full API server.
Flags
| Flag | Type | Required | Description |
|---|
--input | TEXT | Yes | The text to scan |
--profile | lite | standard | full | No | Detection profile to use |
Examples
# Test a known prompt injection string
inferwall test --input "Ignore all previous instructions"
# Test with the standard profile (requires ML models)
inferwall test --input "Ignore all previous instructions" --profile standard
# Test with the lite profile (heuristic only, fastest)
inferwall test --input "What is the weather today?" --profile lite
inferwall admin setup
Generates a scan API key (IW_API_KEY) and an admin API key (IW_ADMIN_KEY), then writes both to .env.local in the current directory. Run this once after installation before starting the server in production.
Example
inferwall admin setup
# Generates .env.local with IW_API_KEY and IW_ADMIN_KEY
source .env.local && inferwall serve
Never commit .env.local or any file containing your API keys to source control.
inferwall models install
inferwall models install --profile PROFILE
Installs the required Python dependencies and downloads the ML models for the specified profile in a single step. This is the recommended one-command setup for Standard and Full profiles.
Flags
| Flag | Values | Required | Description |
|---|
--profile | standard, full | Yes | Profile to install models for |
Models are downloaded from HuggingFace and cached in ~/.cache/inferwall/models/.
| Model | Size | Engine | Profile |
|---|
| DeBERTa v3 (injection) | ~400 MB | Classifier | Standard |
| DistilBERT (toxicity) | ~520 MB | Classifier | Standard |
| MiniLM-L6 (embeddings) | ~80 MB | Semantic | Standard |
| Phi-4 Mini Q4 (judge) | ~2.4 GB | LLM-Judge | Full |
Examples
# Install everything for the Standard profile (~1 GB total)
inferwall models install --profile standard
# Install everything for the Full profile (~3.4 GB total)
inferwall models install --profile full
inferwall models download
inferwall models download --profile PROFILE
Downloads ML model weights only, without installing Python dependencies. Use this when you have already installed the package extras (inferwall[standard] or inferwall[full]) and only need to fetch the model files.
Flags
| Flag | Values | Required | Description |
|---|
--profile | standard, full | Yes | Profile to download models for |
Examples
# Download models for Standard (skips pip install)
inferwall models download --profile standard
# Download models for Full
inferwall models download --profile full
inferwall models list
Lists all ML model files that are currently downloaded and present in the local model cache (~/.cache/inferwall/models/).
Example
inferwall models status
Shows the download status of all models across every profile — indicating which models are present and which are missing. Use this to confirm your installation is complete before starting the server.
Example
Run inferwall models status after inferwall models install to confirm all expected models downloaded successfully.