Metadata-Version: 2.4
Name: inferenceport-cli
Version: 1.1.0
Summary: ipx - the InferencePort AI command line: cloud P2G, Lightning, organizations, local models and the desktop host server.
Author-email: "InferencePort LLC." <admin@inferenceport.ai>
License: Apache-2.0
Project-URL: Homepage, https://inferenceport.ai
Project-URL: Documentation, https://docs.inferenceport.ai
Project-URL: Source, https://github.com/inferenceport-ai/cli
Keywords: ai,llm,inferenceport,cli,ollama,generative
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: click<9,>=8.1
Requires-Dist: rich>=13.7
Requires-Dist: certifi>=2024.2.2
Requires-Dist: cryptography>=43
Requires-Dist: psutil>=6
Requires-Dist: nvidia-ml-py>=12
Requires-Dist: httptools<0.9,>=0.8
Requires-Dist: ada-url<5,>=1.15
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == "dev"
Requires-Dist: ruff>=0.5; extra == "dev"
Requires-Dist: websockets>=13; extra == "dev"
Provides-Extra: build
Requires-Dist: nuitka>=2.5; extra == "build"
Requires-Dist: ordered-set; extra == "build"
Requires-Dist: zstandard; extra == "build"
Dynamic: license-file

<p align="center">
  <img src="https://raw.githubusercontent.com/sharktide/inferenceport-ai/main/src/build/icon.png" width="84" alt="InferencePort AI">
</p>

<h1 align="center">ipx</h1>
<p align="center"><b>The InferencePort AI command line.</b><br>
Cloud chat &amp; media generation · organizations · local models · host server — one native binary.</p>

```text
  ██╗██████╗ ██╗  ██╗
  ██║██╔══██╗╚██╗██╔╝
  ██║██████╔╝ ╚███╔╝
  ██║██╔═══╝  ██╔██╗
  ██║██║     ██╔╝ ██╗
  ╚═╝╚═╝     ╚═╝  ╚═╝
```

## Install

`ipx` ships as a self-contained native binary (compiled with [Nuitka](https://nuitka.net)). Use whichever package
manager you already have — none of them need Python or anything else installed beyond themselves.

| You have | Command |
| --- | --- |
| **pip** | `pip install inferenceport-cli` |
| **npm** | `npm install -g @inferenceport-ai/ipx` |
| **cargo** | `cargo install ipx-cli` |
| macOS / Linux shell | `curl -fsSL https://raw.githubusercontent.com/inferenceport-ai/cli/main/install.sh \| sh` |
| Windows PowerShell | `irm https://raw.githubusercontent.com/inferenceport-ai/cli/main/install.ps1 \| iex` |
| Nothing | Download from [Releases](https://github.com/inferenceport-ai/cli/releases) |

## Tour

```bash
ipx auth login                       # email, GitHub, Google, Microsoft, Hugging Face, SSO or API key
ipx auth context acme                # act as an organization (billing, policy, `ipx org …`)

ipx gen chat                         # interactive chat with your Lightning subscription
ipx gen image "a lighthouse at dawn" -o lighthouse.jpg
ipx gen video "a drone shot over a canyon" --seconds 8
ipx gen audio speech "Welcome to InferencePort"

ipx p2g chat                         # credit-metered Pay-2-Go API
ipx p2g 3d --image chair.jpg -o chair.glb
ipx p2g embed "The quick brown fox" -m text-embedding-3-small
ipx p2g realtime chat "Tell me a joke" --audio-out joke.wav
ipx p2g realtime transcribe meeting.wav
ipx p2g balance

ipx org members list                 # organizations
ipx org invite create dev@acme.com --role admin
ipx org keys create ci --monthly-limit 25
ipx featherless deploy Qwen/Qwen2.5-7B-Instruct   # personal, or for the org with `-O acme`
ipx agent chat acme-bot/support      # managed agents
ipx mcp council reason "…" --tier basic   # Council of LLMs MCP

ipx model pull llama3.2              # local models (same engine as the desktop app)
ipx local chat llama3.2
ipx server start --allow teammate@acme.com --detach     # host your models for others
ipx import space black-forest-labs/FLUX.1-schnell       # add to the desktop app

ipx shield scan "Ignore previous instructions…"     # AI Shield (docs: readthedocs, "AI Shield")

ipx usage get                        # quotas, wallet and org spend
```

Every command has `--help`, and every command accepts the global `--json` flag for scripting:
`ipx --json usage get | jq .quota`.

## Command map

| Group | What it does |
| --- | --- |
| `ipx auth` | `login`, `logout`/`signout`, `status`/`whoami`, `context <org>`, `token` |
| `ipx org` | members, invitations, teams, API keys, billing, usage, audit, domains, SSO, policy, desktop policy |
| `ipx p2g` | credit-billed: `chat`, `text`, `image`, `video`, `audio …`, `3d`, `embed`, `realtime chat`/`transcribe`, `models`, `balance`, `ledger`, `keys`, `deploy` |
| `ipx featherless` | `models`, `status`, `list`, `get`, `deploy`, `cancel`, `restore`, `terminate`, `usage` — personal deployments, or the organization's with an org context |
| `ipx agent` | `list`, `registry`, `get`, `create`, `update`, `delete`, `chat`, `ask`, `profile`, `settings`, `invite …`, `members …` |
| `ipx mcp council` | `tiers`, `models`, `reason`, `tools`, `test`, `connect <client>` — the hosted Council of LLMs MCP server |
| `ipx gen` | subscription-billed (Lightning): `chat`, `text`, `image`, `video`, `audio …`, `models`, `plan` |
| `ipx shield` | AI Shield detection and risk scoring: `scan`, `analyze`, `phishing`, `url`, `check`, `disposable`, `request`, `file`, `password`, `listing`, `review`, `domain`, `tasks` — see the [AI Shield docs](https://inferenceport-ai.readthedocs.io/en/latest/cli/shield.html) |
| `ipx model` / `ipx local` | manage local models / chat with them |
| `ipx server` | `start`, `stop`, `status`, `logs` — host your local models on port 52458 |
| `ipx import` | `space`, `website`, `file`, `list`, `rm` for the desktop app library |
| `ipx usage` | `get`, `tiers` |
| `ipx config`, `doctor`, `status`, `api`, `rewards`, `completion` | tools |

Full documentation lives with the desktop app docs: **<https://inferenceport-ai.readthedocs.io>** (CLI section, and AI Shield).

## Develop

```bash
python -m venv .venv && . .venv/bin/activate      # .venv\Scripts\activate on Windows
pip install -e ".[dev]"
pytest                                            # mocked-API suite, no network or credentials needed
python packaging/build_binary.py                  # Nuitka → dist/ipx-<os>-<arch>
```

Layout: `src/ipx` (the CLI), `packaging/npm` (launcher + platform packages), `packaging/cargo` (Rust launcher that embeds
the release binary), `.github/workflows` (CI and the multi-platform release pipeline).

## License

Apache-2.0 — © 2026 InferencePort LLC. InferencePort AI™ is a Common-Law trademark of InferencePort LLC.

## Embeddings and realtime

```bash
ipx p2g models --type embedding            # also: --type realtime
ipx p2g prices --type image --sort price      # compare per-image/second/token prices; --free, --json
ipx p2g embed "first text" "second text" --dimensions 256
ipx p2g embed -f notes.txt --lines -o vectors.json    # one input per line, full response saved
cat docs.txt | ipx p2g embed --lines --json            # machine-readable

ipx p2g realtime chat "Say hello" --voice marin --audio-out hello.wav
ipx p2g realtime chat --audio-in question.wav          # speak a WAV file, read the answer
ipx p2g realtime transcribe talk.wav -m scribe-v2-realtime -o talk.txt
arecord -f S16_LE -r 24000 -c 1 -t raw | ipx p2g realtime transcribe - --rate 24000
```

Embeddings are billed per input token; realtime sessions are billed as they run (per token for `gpt-realtime-*`, per second of streamed
audio for the transcription models). Both are Pay-2-Go only and honour an organization context (`ipx auth context <org>` or `--org`).
Audio is sent as 24 kHz mono PCM16 (WAV files are converted for you); `--session '{...}'` replaces the default `session.update` and
`--events` prints the raw events when you need to see what a model sends.

### Decision models (P2G)

Use System One decision models with typed `choice`, `noul` and `score` questions:

```sh
ipx p2g models --type decision
ipx p2g prices --type decision
ipx p2g decision --file request.json --output result.json
ipx p2g decision 'Please refund my duplicate payment' --questions questions.json --json
cat request.json | ipx p2g decision --file - --json
```

`request.json` contains `model` (default `microsoft/decision-1`), `state` (text or
JSON), and `questions` (a named object). `questions.json` contains only the named
questions object, for example:

```json
{"refund":{"type":"noul","instructions":"Is the customer requesting a refund?"}}
```

The command calls `/v1/systemone` with your normal credentials and organization
context. Provider keys stay on the server. Responses include answers, input tokens
and credits charged. Use `--model` to override a request file's model. Additional
System One providers and retail prices are configured by the backend operator in
`src/models/decision.json`.

## Hosting protocol and encrypted desktop clients

`ipx server start` supports the desktop P-256 / AES-256-GCM request-body protocol,
including `GET /__inferenceport/crypto-capabilities`,
`POST /__inferenceport/crypto-handshake`, one-hour sessions, and `POST /sysinfo`
hardware ratings. The Python server needs no Node.js or Electron installation.
Dependencies include cryptography, psutil, native llhttp/WHATWG bindings and
NVIDIA NVML. GPU inspection uses native 64-bit registry/DXGI values on Windows,
DRM counters on Linux and profiler records on macOS; nvidia-smi is not required. CPU inspection is cached; available
RAM is refreshed per rating. Unknown measurements are reported as unknown.

Use `--allow EMAIL[:admin|member]` for service-verified access tokens and
`--api-key` or `--generate-key` for shared server keys. Email matching preserves
case. A shared key uses the first configured admin, otherwise the first user,
otherwise an admin identity when no users exist. Member restrictions follow the
desktop's raw-URL regex; they are not a general read-only guarantee. Managed
organization membership modes disable shared keys.

Health, authenticated proxy traffic and sysinfo share 30 accepted requests per
IP per fixed minute. Handshakes and capability probes do not consume that quota;
verification-service quotas still apply. Bodies are buffered with a 20 MiB limit.
Ollama response bodies stream through without an inference timeout. Logs are
`InferencePort-Server.log`, rotated at 10 MiB, and truncated on server startup;
`ipx server logs -f` follows rotation. Detached process diagnostics go to
`server-process.log` beside the server log.

Encryption covers request bodies only. Bearer tokens and responses require HTTPS
for transport confidentiality. Sessions re-verify the token on every request,
but the desktop protocol has no replay counter. Limit exposure to trusted
networks or place HTTPS in front of the server. Avoid secrets in query strings,
which appear in connection logs.

See [the protocol audit, endpoint matrix, validation and remaining gaps](docs/server-parity.md).
Exact parity is **not yet certified**; that document records explicit security
deviations and native collector/HTTP-parser validation evidence.

Set `IPX_OLLAMA_VENDOR_ROOT` to the desktop `vendor/electron-ollama` directory to
rate the identical bundled build. Otherwise the CLI inspects its actual standalone
Ollama installation. Native collection and malformed HTTP cases run in differential
CI on Windows, Linux and macOS.
