{"slug": "skyportal-sre-an-open-source-ai-infrastructure-engineer", "title": "Skyportal SRE – an open-source AI infrastructure engineer", "summary": "Skyportal released an open-source Python SDK and persistent terminal client for its AI infrastructure platform, enabling developers to interact with the SkyPortal API for tasks such as monitoring training nodes and managing server-side agents. The SDK, available under an alpha release, includes features like chat-based agent interaction, approval workflows, and observability endpoints, with support for self-hosted deployments.", "body_md": "The official Python SDK and persistent terminal client for the\n[SkyPortal](https://skyportal.ai) API.\n\nProject status:Alpha. APIs may evolve before 1.0; changes are documented in GitHub releases.\n\n```\nUser app  →  skyportalai (SDK)  →  SkyPortal HTTP API\npip install skyportalai\n# or\npoetry add skyportalai\n```\n\nRequires Python 3.11+.\n\nThe local observability agent has one additional dependency set:\n\n```\npip install \"skyportalai[agent]\"\npython\nfrom skyportalai import Skyportal\n\nclient = Skyportal(api_key=\"sk-...\")   # or set SKYPORTAL_API_KEY\nuser = client.me()\nprint(user.name)\n```\n\n`Skyportal`\n\ncan be used as a context manager when the SDK owns the HTTP\nsession:\n\n```\nwith Skyportal(api_key=\"sk-...\") as client:\n    print(client.me().name)\n```\n\n`client.chat`\n\nwraps the headless agent API: create a chat, poll it, resolve\napprovals, and read the run's messages — the agent itself runs server-side.\n\n```\nchat = client.chat.create_chat(\"check disk usage on the training node\", server_id=12)\n\n# Poll until the agent settles; approve any command it asks to run.\nstatus = chat.wait(on_approval=lambda a: True)          # True approves, False rejects\nprint(status.status)                                    # \"idle\"\n\nfor m in chat.messages().messages:\n    print(f\"{m.role}: {m.content}\")\n```\n\nWithout an `on_approval`\n\ncallback, `wait()`\n\nreturns as soon as the agent needs\na decision, and you resolve it yourself:\n\n```\nstatus = chat.wait()\nif status.status == \"awaiting_approval\":\n    for approval in status.pending_approvals:\n        print(\"agent wants to run:\", approval.command)\n        chat.approve(approval.approval_id, command=approval.command)\n    status = chat.wait()\n```\n\nFollow-ups go through `chat.send(\"...\")`\n\n; `chat.cancel()`\n\nstops an active run.\nRead-only introspection mirrors the observability endpoints: `chat.events()`\n\n,\n`chat.tool_calls()`\n\n, `chat.reasoning()`\n\n, `chat.plans()`\n\n, `chat.evaluations()`\n\n,\n`chat.environment()`\n\n.\n\n`wait()`\n\nraises `WaitTimeoutError`\n\nif the agent is still busy past `timeout`\n\n(default 300s).\n\n| Argument | Env var | Default | Notes |\n|---|---|---|---|\n`api_key` |\n`SKYPORTAL_API_KEY` |\n— | required; sent as `Authorization: Bearer <key>` |\n`base_url` |\n`SKYPORTAL_BASE_URL` |\n`https://app.skyportal.ai` |\nAPI root; trailing slash optional |\n`timeout` |\n— | `30.0` |\nper-request seconds |\n`max_retries` |\n— | `2` |\nretries for GET on network error / 5xx |\n\n```\nclient = Skyportal(api_key=\"sk-...\", base_url=\"http://localhost:8000\", timeout=10)\n```\n\nRemote targets must use HTTPS because every request carries a Bearer key. Plain HTTP is accepted for loopback development only. Valid self-hosted HTTPS deployments are fully supported.\n\nEvery failure is a `skyportalai`\n\nexception — a raw `requests`\n\nerror never escapes:\n\n``` python\nfrom skyportalai import Skyportal, AuthenticationError, APIConnectionError, APIError\n\ntry:\n    Skyportal(api_key=\"bad\").me()\nexcept AuthenticationError:\n    ...   # 401/403, or the key was rejected\nexcept APIConnectionError:\n    ...   # network failure / timeout\nexcept APIError as e:\n    ...   # other non-2xx; e.status_code, e.body\n```\n\nHierarchy: `SkyportalError`\n\n▸ `APIConnectionError`\n\n, `APIStatusError`\n\n▸ `AuthenticationError`\n\n, `APIError`\n\n.\n\nThe package installs two complementary commands:\n\n`skyportal`\n\nis the interactive command center, with login, server selection, persistent chat state, and approval prompts.`skyportalai`\n\nis the script-friendly Typer CLI, with stable`--json`\n\noutput for chat and configuration operations.\n\n```\nskyportal                    # start the interactive command center\nskyportal start              # same as above\nskyportal login              # browser-guided API-key setup\nskyportal login --token      # paste an existing credential\nskyportal ask \"List my hosts\"\nskyportal ask --server 42 \"Show disk usage\"\nskyportal servers\nskyportal logout\nskyportal configure --portal-url https://your-skyportal.example\n```\n\nFor a self-installing local launcher, clone the repository and run `./run.sh`\n\n.\nIt provisions a virtual environment, installs this package, displays the\nanimated Skyportal astronaut, and opens the command center.\n\nAt the interactive prompt, `/login`\n\nopens the API-key page and guides you\nthrough connecting the terminal. Credentials are validated before being stored\nin `~/.skyportal/credentials.json`\n\nwith user-only permissions.\n\nInteractive commands:\n\n```\n/help                 Show commands\n/login                Open API-key setup and connect\n/token                Reopen API-key setup and paste a credential\n/logout               Remove the saved credential\n/status               Show API, chat, and server context\n/new                  Start a new agent chat\n/servers              List owned servers\n/server <id>          Select a server for agent execution\n/server auto          Let the agent choose a server\n/clear                Clear the terminal\n/exit                 Exit\n```\n\nCLI configuration is stored in `~/.skyportal/config.yaml`\n\n. Environment\noverrides include `SKYPORTAL_URL`\n\n, `SKYPORTAL_ACCESS_TOKEN`\n\n,\n`SKYPORTAL_CONFIG_PATH`\n\n, `SKYPORTAL_CREDENTIALS_PATH`\n\n,\n`SKYPORTAL_HISTORY_PATH`\n\n, `SKYPORTAL_NO_ANIMATION`\n\n, and\n`SKYPORTAL_ANIMATION_SPEED`\n\n.\n\nSee [CLI architecture](/SkyportalAi/skyportalai/blob/main/docs/architecture.md) and\n[CLI deployment](/SkyportalAi/skyportalai/blob/main/docs/deployment.md) for more detail.\n\n```\nskyportalai config show\nskyportalai chat send --server 42 --wait \"Show disk usage\"\nskyportalai chat status 123\nskyportalai --json chat messages 123\n```\n\nRun `skyportalai --help`\n\nor `skyportalai chat --help`\n\nfor the full command\nreference. It uses `SKYPORTAL_API_KEY`\n\nfirst and can also read credentials saved\nby `skyportal login`\n\n.\n\n`skyportal-agent`\n\ndiscovers W&B and MLflow experiment metadata, buffers it in a\ndisk-backed queue, and uploads it with bounded retries. Its config/tag redaction\nremoves credential-like values before persistence, but operators must still\nrestrict scan roots and protect the state directory.\n\nSee [observability agent deployment and data handling](/SkyportalAi/skyportalai/blob/main/docs/agent.md) before\nrunning it on experiment volumes.\n\n```\npoetry install --all-extras\npoetry run pytest\npoetry run ruff check .\npoetry check --strict\n```\n\nIssues and pull requests are welcome. See [CONTRIBUTING.md](/SkyportalAi/skyportalai/blob/main/CONTRIBUTING.md) for\ndevelopment setup, tests, and the pull request process, and\n[CODE_OF_CONDUCT.md](/SkyportalAi/skyportalai/blob/main/CODE_OF_CONDUCT.md) for community expectations. Supported\nPython versions are 3.11, 3.12, and 3.13.\n\nDo not open a public issue for a vulnerability. Follow the private reporting\ninstructions in [SECURITY.md](/SkyportalAi/skyportalai/blob/main/SECURITY.md).\n\nReleased under the [MIT License](/SkyportalAi/skyportalai/blob/main/LICENSE).", "url": "https://wpnews.pro/news/skyportal-sre-an-open-source-ai-infrastructure-engineer", "canonical_source": "https://github.com/SkyportalAi/skyportalai", "published_at": "2026-07-16 21:13:34+00:00", "updated_at": "2026-07-16 21:25:03.815569+00:00", "lang": "en", "topics": ["ai-infrastructure", "developer-tools", "ai-agents", "ai-tools"], "entities": ["Skyportal", "Skyportal API", "Python SDK"], "alternates": {"html": "https://wpnews.pro/news/skyportal-sre-an-open-source-ai-infrastructure-engineer", "markdown": "https://wpnews.pro/news/skyportal-sre-an-open-source-ai-infrastructure-engineer.md", "text": "https://wpnews.pro/news/skyportal-sre-an-open-source-ai-infrastructure-engineer.txt", "jsonld": "https://wpnews.pro/news/skyportal-sre-an-open-source-ai-infrastructure-engineer.jsonld"}}