DocsQuickstart

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.

~5 min · Python 3.9+ required
1

Install the PlexRun SDK

Install the Python SDK using pip:

terminal
$ pip install plexrun

This installs the plexrun Python package and the plexrun CLI. Verify the installation:

terminal
$ plexrun --version
plexrun 0.4.1
2

Authenticate your account

Log in with your PlexRun account. This stores credentials locally at ~/.plexrun/credentials.

terminal
$ 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.

3

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.

triage.py
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.

4

Deploy to production

Deploy your workflow with a single command. PlexRun provisions the required compute and queue infrastructure inside your account automatically.

terminal
$ 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
5

Trigger a run

Run your workflow with a JSON payload from the CLI or via the API:

terminal
$ 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
$ 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": "..."}}'
6

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:

terminal
$ 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

Need help? Reach us at hello@plexrun.com or open an issue on GitHub. We respond within 24 hours during early access.