> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ns.rocks/llms.txt
> Use this file to discover all available pages before exploring further.

# Agent Deployment Service

> Deploy a minimal local agent project as a Nullspace service.

This example uses
`examples/python/agent_deployments/minimal_service/nullspace.agent.toml` to
package a Python HTTP server, start it as a managed service, and fetch its
public URL.

## Setup

```bash theme={"theme":{"light":"one-light","dark":"one-dark-pro"}}
uv pip install "nullspace-sdk[cli]==1.0.0"
export NULLSPACE_API_KEY=ns_live_...
export NULLSPACE_API_URL=https://api.your-nullspace-domain
cd examples/python/agent_deployments/minimal_service
```

## CLI

```bash theme={"theme":{"light":"one-light","dark":"one-dark-pro"}}
nullspace agent deploy .

nullspace agent url minimal-service-agent \
  --env EXAMPLE_AGENT_GREETING=hello

nullspace agent status minimal-service-agent --service adsvc_123
nullspace agent logs minimal-service-agent --service adsvc_123
nullspace agent stop minimal-service-agent --service adsvc_123
nullspace agent delete minimal-service-agent --yes
```

The service binds to `0.0.0.0:8000`, exposes `/health`, and uses
`permissions.public_url = true` so `nullspace agent url` can return a public
endpoint. Expected output includes a public URL, a ready service status, and a
`/health` response with `{"ok": true}`.

## Python

The companion `run.py` script uses the same deployment contract through the SDK:

```python theme={"theme":{"light":"one-light","dark":"one-dark-pro"}}
from pathlib import Path

from nullspace import AgentDeployment

project = Path(__file__).resolve().parent
deployment, version, manifest = AgentDeployment.deploy(path=project)
service = deployment.start_service(envs={"EXAMPLE_AGENT_GREETING": "hello"})
url = deployment.service_url(service.id)
print(deployment.name, version.id, len(manifest.entries), url.public_url)
```

Run the complete script:

```bash theme={"theme":{"light":"one-light","dark":"one-dark-pro"}}
python run.py
```

## Project Files

```text theme={"theme":{"light":"one-light","dark":"one-dark-pro"}}
examples/python/agent_deployments/minimal_service/
  README.md
  server.py
  run.py
  nullspace.agent.toml
```

Related: [Agent Deployments](../agents/deployments),
[Preview URLs](../networking/preview-urls), and [CLI reference](../reference/cli).
