Getting started
Quickstart
Deploy your first AI workflow in under 5 minutes. This guide walks through installation, defining a workflow, and running it in production.
Install the PlexRun SDK
Install the Python SDK using pip:
$ pip install plexrun
This installs the plexrun Python package and the plexrun CLI. Verify the installation:
$ plexrun --version plexrun 0.4.1
Authenticate your account
Log in with your PlexRun account. This stores credentials locally at ~/.plexrun/credentials.
$ plexrun auth login ✓ Authenticated as you@company.com Project: my-project · Region: us-east-1
Don't have an account yet? Request early access to get your credentials.
Define your first workflow
Create a file called triage.py. PlexRun workflows are Python functions decorated with @workflow. Each step is a function decorated with @step.
from plexrun import workflow, step, LLMClient @workflow("customer-triage", retry=3) def triage_pipeline(ticket: dict) -> dict: # Steps run in sequence, each with full tracing intent = extract_intent(ticket["body"]) priority = classify_priority(intent) response = generate_reply(intent, priority) return {"priority": priority, "reply": response} @step(model="claude-3-haiku") def extract_intent(body: str) -> str: return LLMClient.complete(f"Classify the intent of: {body}") @step(model="claude-3-haiku") def classify_priority(intent: str) -> str: return LLMClient.complete(f"Priority for '{intent}': low/medium/high?") @step(model="claude-3-sonnet") def generate_reply(intent: str, priority: str) -> str: return LLMClient.complete(f"Write a {priority} priority reply for: {intent}")
Each @step function runs with automatic retries, token tracking, and execution tracing. No boilerplate required.
Deploy to production
Deploy your workflow with a single command. PlexRun provisions the required compute and queue infrastructure inside your account automatically.
$ plexrun deploy triage.py Packaging workflow... Validating step graph... Provisioning workers [us-east-1]... ✓ Deployed: customer-triage · v1 Dashboard: https://app.plexrun.com/w/customer-triage
Trigger a run
Run your workflow with a JSON payload from the CLI or via the API:
$ plexrun run customer-triage \ --input '{"body": "My account is locked and I have a meeting in 10 min"}' [1/3] extract_intent 87ms ✓ [2/3] classify_priority 112ms ✓ [3/3] generate_reply 341ms ✓ ✓ Complete · 540ms · $0.0009 priority: "high" reply: "I understand this is urgent...
Or trigger via the REST API from any language:
$ curl -X POST https://api.plexrun.com/v1/run \ -H "Authorization: Bearer $PLEXRUN_API_KEY" \ -H "Content-Type: application/json" \ -d '{"workflow": "customer-triage", "input": {"body": "..."}}'
Inspect execution traces
Every run is fully traced. Use the CLI or open the dashboard to inspect per-step latency, token usage, model costs, and logs:
$ plexrun logs customer-triage --run-id run_8kTx92 run_8kTx92 · customer-triage v1 · 540ms · SUCCESS ├── extract_intent 87ms 1.2k tokens $0.0002 ├── classify_priority 112ms 0.8k tokens $0.0001 └── generate_reply 341ms 2.1k tokens $0.0006
What's next
Need help? Reach us at hello@plexrun.com or open an issue on GitHub. We respond within 24 hours during early access.