Skip to main content

Python SDK for ARK - Agentic Runtime for Kubernetes

Project description

ARK Python SDK

Python SDK for ARK - Agentic Runtime for Kubernetes. This SDK is part of the open source Agents at Scale ARK project.

This package provides Python bindings for managing ARK agents, models, queries, and other resources in Kubernetes. It is partly generated from the ARK Custom Resource Definitions (CRDs), with additional capabilities layered on top.

Installation

pip install ark-sdk

Usage

Kubernetes Resource Management

from ark_sdk import ARKClientV1alpha1
from ark_sdk.models.agent_v1alpha1 import AgentV1alpha1, AgentV1alpha1Spec

# Initialize client
client = ARKClientV1alpha1(namespace="default")

# Create agent
agent = AgentV1alpha1(
    metadata={"name": "my-agent"},
    spec=AgentV1alpha1Spec(prompt="Hello", modelRef={"name": "gpt-4"})
)
created = client.agents.create(agent)

# Get, update, delete
agent = client.agents.get("my-agent")
agent.spec.prompt = "Updated"
client.agents.update(agent)
client.agents.delete("my-agent")

Execution Engine Development

The SDK now includes utilities for building execution engines:

from ark_sdk import BaseExecutor, ExecutorApp, ExecutionEngineRequest, Message

class MyExecutor(BaseExecutor):
    def __init__(self):
        super().__init__("MyEngine")
    
    async def execute_agent(self, request: ExecutionEngineRequest) -> List[Message]:
        # Your execution logic here
        return [Message(role="assistant", content="Hello from my engine!")]

# Create and run the executor
executor = MyExecutor()
app = ExecutorApp(executor, "MyEngine")
app.run(host="0.0.0.0", port=8000)

Async Operations

# List agents asynchronously
agents = await client.agents.a_list()

# Create query asynchronously
query = await client.queries.a_create(QueryV1alpha1(...))

Execution Engine Types

The SDK provides common types for execution engines:

  • ExecutionEngineRequest - Request format for agent execution
  • ExecutionEngineResponse - Response format from execution engines
  • AgentConfig - Agent configuration structure
  • Message - Chat message format
  • BaseExecutor - Abstract base class for execution engines
  • ExecutorApp - FastAPI application setup for execution engines

Documentation

For full documentation and examples, visit the ARK project repository.

Requirements

  • Python 3.9+
  • Kubernetes cluster with ARK installed
  • FastAPI and uvicorn (for execution engine development)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ark_sdk-0.1.65rc0-py3-none-any.whl (222.5 kB view details)

Uploaded Python 3

File details

Details for the file ark_sdk-0.1.65rc0-py3-none-any.whl.

File metadata

  • Download URL: ark_sdk-0.1.65rc0-py3-none-any.whl
  • Upload date:
  • Size: 222.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ark_sdk-0.1.65rc0-py3-none-any.whl
Algorithm Hash digest
SHA256 0f9a8804805615606e50cd2a7cd8f136cb92ee81ddf79fa91d1799e26f054a36
MD5 350a9b4d804f38de88b925f85a594f82
BLAKE2b-256 eb55f24d6b776ffb2845c317d6ef8fbec14be0d6cb02792b85df67d0c6680c6d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page