# pnotp — docs for agents

> Official Python client for the **P¬P** platform. One account API key
> (`pnotp_sk_...`) trains models, deploys them as live endpoints, runs inference,
> and powers bring-your-own-brain tool-calling agents. PnotP hosts no frontier
> LLMs — an agent's brain is always your own key (Gemini / DeepSeek /
> OpenAI-compatible) or a model you deployed. The one exception is the optional
> zero-retention `pnotp-compliant` brain.

This site is built for machines. **`curl https://docs.pnotp.ai` returns
markdown**; a browser visiting the same URL gets a rendered page. Append
`?format=md` (or a `.md` suffix) to force markdown, `?format=html` to force HTML.

```bash
curl https://docs.pnotp.ai                 # this page, as markdown
curl https://docs.pnotp.ai/quickstart      # any topic below
curl https://docs.pnotp.ai/llms.txt        # the machine-readable index
curl https://docs.pnotp.ai/llms-full.txt   # every page concatenated (one shot)
```

Ask in plain English (proxies to Toby, the hosted assistant — needs your key):

```bash
curl https://docs.pnotp.ai/ask \
  -H "Authorization: Bearer pnotp_sk_..." \
  -d '{"question":"How do I deploy a model and then call it?"}'
```

## Install & authenticate

```bash
pip install pnotp
export PNOTP_API_KEY="pnotp_sk_..."   # mint in Studio → Settings → API keys (shown once)
```

```python
import pnotp
px = pnotp.Client()                    # reads PNOTP_API_KEY
# or: px = pnotp.Client(api_key="pnotp_sk_...")
# local backend: px = pnotp.Client(base_url="http://localhost:8000/v1")
```

## Quickstart (train → deploy → predict)

```python
import pnotp
px = pnotp.Client()

project = px.projects.create(name="Chest X-ray",
                             task_type="binary_image_classification")
model = px.models.create(
    project["id"], name="cnn-v1",
    architecture=pnotp.architectures.image_classifier(num_classes=2),
)

# dataset = a .zip of class-named folders (image) or a .csv (tabular)
px.train(model.id, dataset="train.zip", epochs=5).wait()

dep = px.deployments.upload(project["id"], name="prod", checkpoint="model.pt")
print(px.predict(dep["deployment"]["id"], "xray.jpg"))
```

## The SDK documents itself (offline, no key)

Prefer in-package help over remembered signatures — it is generated by
introspection and matches the installed version exactly.

```python
pnotp.help()                       # overview + topic list
pnotp.help("agents")               # a topic page
pnotp.help.search("pause a training job")
pnotp.help(pnotp.Agent)            # any symbol's real signature + docstring
pnotp.help.errors                  # the exception catalog
pnotp.help.toby("How do I ...?")   # hosted assistant (needs key + credits)
```

## Topics

- [quickstart](/quickstart) — train → deploy → predict, end to end
- [auth](/auth) — API keys, environment, local backend
- [training](/training) — submit, wait, pause / resume / cancel
- [deployments](/deployments) — upload a checkpoint, manage endpoints + keys
- [inference](/inference) — call a deployment with your key or a `pnp_` key
- [compliance](/compliance) — data-compliant (zero-retention) endpoints
- [compliant-llm](/compliant-llm) — the zero-retention LLM brain (`px.chat`, `pnotp-compliant`)
- [agents](/agents) — bring-your-own-brain tool-calling loop
- [brains](/brains) — model endpoints: Gemini, DeepSeek, OpenAI-compatible, your deployments
- [tools](/tools) — declare tools from typed Python functions
- [architectures](/architectures) — image / tabular architecture graphs
- [credits](/credits) — balance, billing, managing account keys
- [errors](/errors) — the exception catalog and how to handle them
- [toby](/toby) — the hosted assistant + the `/ask` HTTP endpoint
- [api](/api) — the raw HTTP API (base URL, auth headers, key routes)
