Skip to main content

Python SDK for Voke — serverless macOS compute on Apple Silicon

Project description

voke

Python SDK for Voke -- serverless macOS compute on Apple Silicon. Run scripts on ephemeral macOS VMs with one function call.

Install

pip install voke                 # core SDK
pip install voke[langchain]      # + LangChain integration
pip install voke[crewai]         # + CrewAI integration

Quick start

Sync

from voke import Voke

client = Voke()  # reads VOKE_API_KEY from env
result = client.jobs.create(script="uname -m && sw_vers").wait()

print(result.exit_code)  # 0
print(result.stdout)     # arm64\nProductName: macOS\n...

Async

import asyncio
from voke import AsyncVoke

async def main():
    client = AsyncVoke()
    job = await client.jobs.create(script="uname -m")
    result = await job.async_wait()
    print(result.stdout)
    await client.close()

asyncio.run(main())

API reference

Voke(api_key=None, base_url="https://api.voke.run")

Create a sync client. If api_key is not provided, reads VOKE_API_KEY from environment.

client.jobs.create(script, *, image="base", timeout=600, env=None, webhook_url=None) -> Job

Submit a script. Returns a Job object immediately (status will be "queued").

client.jobs.get(job_id) -> Job

Fetch a job by ID.

client.jobs.list(*, limit=20, offset=0, status=None) -> JobList

List your jobs, newest first.

client.jobs.cancel(job_id) -> Job

Cancel a queued job.

job.wait(poll_interval=1.5, timeout=None) -> Job

Poll until the job reaches a terminal state (completed/failed/cancelled).

client.images() -> dict[str, ImageInfo]

List available macOS images.

client.usage() -> UsageResponse

Get current month's usage.

Images

Image Description
base Clean macOS Sonoma 14.8 with dev tools
xcode16 base + Xcode 16, Swift 6, CocoaPods, Fastlane

Error handling

from voke.errors import VokeError, AuthenticationError, RateLimitError

try:
    client.jobs.create(script="echo hello")
except AuthenticationError:
    print("Bad API key")
except RateLimitError:
    print("Too many requests")
except VokeError as e:
    print(f"API error {e.status_code}: {e}")

LangChain

from voke.tools.langchain import VokeRunTool

tool = VokeRunTool()  # reads VOKE_API_KEY from env

# Use with an agent
from langchain.agents import AgentExecutor
agent = AgentExecutor(tools=[tool], ...)

# Or call directly
result = tool.invoke({"script": "sw_vers", "image": "base"})

CrewAI

from voke.tools.crewai import VokeTool
from crewai import Agent

macos_tool = VokeTool()

agent = Agent(
    role="macOS Engineer",
    tools=[macos_tool],
    ...
)

Project details


Download files

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

Source Distribution

voke-0.1.0.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

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

voke-0.1.0-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file voke-0.1.0.tar.gz.

File metadata

  • Download URL: voke-0.1.0.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for voke-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9343bffa47eb1a234caa8273669aeffb729cef650971857020ccde4ea428ff13
MD5 6a70a3a778a6de98bd1c5d5f02e5b90a
BLAKE2b-256 b5e1c6988166c934855f54cc7350c5cffe5c872e007147f15a06ea86f8808037

See more details on using hashes here.

File details

Details for the file voke-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: voke-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for voke-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1e9b25a84d302f348789355aa4ab498c4123d567c0ec7865e8432d9289990c7f
MD5 54a54e0c9cec5802fb9a0f4d2dce18f2
BLAKE2b-256 25bedf733c691a8f5c16ffc1fa1ca7dcb871d6d3979a3eaa4cf124192ac4d478

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