Skip to main content

kestrel-cloud-gcp

GCP Compute Engine provider for Kestrel Sovereign agents. Provision GPU instances, run LoRA training jobs over SSH, and manage instance lifecycle from your agent's tools.

Installation

uv pip install kestrel-cloud-gcp

The feature is auto-discovered by Kestrel Sovereign via the kestrel_sovereign.features entry point — install it alongside kestrel-sovereign and GCPComputeFeature registers itself at startup.

Configuration

Variable Description
GCP_PROJECT_ID GCP project ID (required)
GOOGLE_APPLICATION_CREDENTIALS Path to service-account JSON (or use ADC / Workload Identity)

Optional [gcp_compute] section in kestrel.toml:

[gcp_compute.manager]
default_zone = "us-central1-a"
default_region = "us-central1"
prefer_spot = true

What's provided

  • GCPComputeFeature — agent-facing tools to provision/list/stop GPU instances, run training over SSH, monitor jobs
  • Standalone API: GCPComputeEngineManager for direct programmatic use
  • Spot-instance preference + automatic lifecycle (TTL, budget caps)

Vertex Custom Job admission and recovery

Starting in kestrel-cloud-gcp 0.3.0, kestrel_cloud_gcp.vertex_jobs provides US Vertex AI v1 Custom Job submission and recovery. Bind the original dispatch digest with vertex_operation_label_value and use find_vertex_custom_job with an authenticated GET callback to recover the exact job after a lost submit response. The search rejects multiple matches, foreign identities, and incomplete pages. An empty result never authorizes a repeat submission. Verify subsequent status with the exact job URL and VertexCustomJobObservation.from_readback.

VertexCustomJobClient.from_adc() uses Google Application Default Credentials to submit an already-persisted VertexCustomJobPlan through the regional v1 API. It does not replay a create, follow redirects, or treat an acknowledged cancel as proof. Persist the exact job identity or recover it by operation label; cancel only that identity and verify terminal state through readback. The caller owns spend admission, queue and execution deadlines, reconciliation, and catalog artifact custody. The adapter does not retain trainer arguments, outputs, or raw provider error bodies.

VertexCustomJobPlan prepares the US v1 request for one GPU container without sending it. The image must be digest-pinned in regional Artifact Registry, the worker must have an explicit workload service account, and the runtime limit and last submission time must fit its admission deadline. The runtime limit does not bound time spent queued; the caller must own absolute-deadline cancellation. This class does not call create or cancel. The container receives one derived environment value, KESTREL_VERTEX_OPERATION_SHA256, matching the original digest encoded in the management label. It is a correlation key only, never proof of identity or authorization to fetch artifacts. The job plan accepts no ambient worker environment, custom arguments, or user artifact credentials.

Dependencies

  • kestrel-sovereign-sdk>=0.2,<1 — base Feature, tool, ToolCategory, BackendType interfaces
  • kestrel-sovereign>=0.5,<1 — kestrel.toml unified-config loader (runtime)
  • google-cloud-compute>=1.15.0
  • google-cloud-logging>=3.5.0

Development

uv pip install -e '.[test]'
uv run pytest

PyPI releases use an immutable version tag on main. Tag CI verifies the version and installs the same wheel that it hands to the trusted-publishing job, together with its source distribution. It does not rebuild after CI.

License

Apache-2.0

Metadata

Release files for kestrel-cloud-gcp 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kestrel-cloud-gcp 0.3.0
File Size Uploaded Provenance Actions
kestrel_cloud_gcp-0.3.0.tar.gz 29.5 kB With provenance Details for kestrel_cloud_gcp-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kestrel-cloud-gcp 0.3.0
File Interpreter ABI Platform Actions
kestrel_cloud_gcp-0.3.0-py3-none-any.whl Python 3 none any Details for kestrel_cloud_gcp-0.3.0-py3-none-any.whl

Total release size: 63.7 kB

Release files / kestrel_cloud_gcp-0.3.0.tar.gz

Download URL kestrel_cloud_gcp-0.3.0.tar.gz
Size 29.5 kB
Tags Source
SHA-256 checksum
How to use checksums
70e5ddd4a5e38f3393b457859697e15ac72b0ed8df34c31e56ae6fa9ef30de82
BLAKE2b-256 checksum
How to use checksums
65bbca17e8db1c284b007813f5b422ef117ac58c1561e6433946e493ae41de4d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Release files / kestrel_cloud_gcp-0.3.0-py3-none-any.whl

Download URL kestrel_cloud_gcp-0.3.0-py3-none-any.whl
Size 34.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8840cd2a2d02672137f31ee413de574e178da42d3691b89043099b1fef94c7db
BLAKE2b-256 checksum
How to use checksums
605ee07d0a94048068486424466b77da5c7fbe77b51007f22c60f48bdce82aeb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Security for kestrel-cloud-gcp 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for kestrel_cloud_gcp-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page