Skip to main content

Runtime engine for PlsAutomate generated applications

Project description

plsautomate-runtime

Runtime engine for PlsAutomate generated applications. Provides a FastAPI server that executes LLM-powered processes with cost tracking, execution logging, secret management, and file handling.

Completely vibe-coded in 1 hour.

Installation

pip install plsautomate-runtime

With optional extras:

# Langfuse observability
pip install plsautomate-runtime[langfuse]

# Azure Key Vault secrets
pip install plsautomate-runtime[azure]

# AWS Secrets Manager
pip install plsautomate-runtime[aws]

# Everything
pip install plsautomate-runtime[all]

Quick start

1. Create a config file

Create plsautomate.config.yaml in your project root:

project:
  id: my-project

llm:
  model: anthropic/claude-sonnet-4-6

processes:
  classify:
    process_id: classify
    trigger:
      type: webhook
    instructions: |
      Classify the incoming support ticket into one of: billing, technical, general.

2. Set your API keys

export ENDPOINT_API_KEYS=my-secret-key
export ANTHROPIC_API_KEY=sk-ant-...

ENDPOINT_API_KEYS is a comma-separated list of keys that authenticate requests to the runtime.

3. Start the server

plsautomate-runtime start --config plsautomate.config.yaml

The server starts on http://localhost:8000 by default.

4. Call a process

curl -X POST http://localhost:8000/process/classify \
  -H "Authorization: Bearer my-secret-key" \
  -H "Content-Type: application/json" \
  -d '{"ticket_text": "I cannot log in to my account"}'

API endpoints

Method Path Description
GET /health Health check with version and uptime
POST /process/<name> Execute a process (authenticated)
GET /executions Query execution history
GET /executions/:id Single execution detail
GET /executions/stats Aggregated cost, latency, and volume stats

Configuration

The runtime is configured via plsautomate.config.yaml. Environment variables can be referenced with ${VAR_NAME} syntax.

Top-level sections

project:
  id: my-project              # Required: project identifier
  plsautomate_url: https://...   # Optional: PlsAutomate server URL
  version: 1.0.0

llm:
  model: anthropic/claude-sonnet-4-6  # Default LLM model (LiteLLM format)

database:
  url: sqlite+aiosqlite:///./data/app.db  # Execution log database

storage:
  type: local          # local or s3
  path: ./data/files   # Local file storage path

auth:
  methods:
    - type: api_key    # api_key or oauth2

secrets:
  provider: env        # env, plsautomate, azure_keyvault, aws_secrets_manager, sap_credential_store

observability:
  langfuse:
    enabled: false
    host: https://cloud.langfuse.com

Process configuration

Each process defines an LLM-powered task:

processes:
  my-process:
    process_id: my-process
    trigger:
      type: webhook           # webhook, schedule, or process
      cron: "0 9 * * *"       # For schedule triggers
      after: other-process    # For process triggers (chaining)
    instructions: |
      Your LLM instructions here...
    llm_model: openai/gpt-4o  # Override default model
    connector: exchange        # Optional: built-in connector
    review:
      enabled: true
      timeout: 24h

Custom process modules

For advanced logic, provide Python modules for the three-phase pipeline:

processes:
  my-process:
    process_id: my-process
    trigger:
      type: webhook
    before_module: processes.my_process.before     # Pre-processing
    execution_module: processes.my_process.execution  # Custom LLM call
    after_module: processes.my_process.after        # Post-processing

Each module should define an async function matching the phase signature. See the PlsAutomate docs for details.

Secret providers

The runtime supports multiple secret backends:

Provider Config value Description
Environment env Read from environment variables (default)
PlsAutomate plsautomate Fetch from PlsAutomate server
Azure Key Vault azure_keyvault Azure Key Vault (pip install plsautomate-runtime[azure])
AWS Secrets Manager aws_secrets_manager AWS Secrets Manager (pip install plsautomate-runtime[aws])
SAP Credential Store sap_credential_store SAP BTP Credential Store

CLI reference

plsautomate-runtime start [OPTIONS]

Options:
  --config PATH   Path to plsautomate.config.yaml (default: plsautomate.config.yaml)
  --host TEXT      Bind host (default: 0.0.0.0)
  --port INT       Bind port (default: 8000)

Development

# Clone and install
git clone https://github.com/JannisConen/plsautomate-runtime.git
cd plsautomate-runtime
pip install -e ".[dev]"

# Run tests
pytest -v

# Lint
ruff check .

License

MIT

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

plsautomate_runtime-0.0.3.tar.gz (364.3 kB view details)

Uploaded Source

Built Distribution

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

plsautomate_runtime-0.0.3-py3-none-any.whl (81.1 kB view details)

Uploaded Python 3

File details

Details for the file plsautomate_runtime-0.0.3.tar.gz.

File metadata

  • Download URL: plsautomate_runtime-0.0.3.tar.gz
  • Upload date:
  • Size: 364.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for plsautomate_runtime-0.0.3.tar.gz
Algorithm Hash digest
SHA256 2455a78f595418373bfcbfeb1039ff31173cf4194969e4004c75c10853c0792c
MD5 43c87e6d63c803a50f54f10f0ce8dfee
BLAKE2b-256 f5e2ab308d02e58f27b60ab11c3ca9f1a379bf7b8b780ffd644824fd9c12627f

See more details on using hashes here.

Provenance

The following attestation bundles were made for plsautomate_runtime-0.0.3.tar.gz:

Publisher: workflow.yml on JannisConen/plsautomate-runtime

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file plsautomate_runtime-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for plsautomate_runtime-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 cce245e833634c197e2b4c6014636bef5b678573303f39688f39bb3561f86b51
MD5 b5326490f45cac9afbe051e22f4009a2
BLAKE2b-256 48460eef32e62e329b2fe7c0a682f5873443b1d16d662c40c10a5e2c79fe7714

See more details on using hashes here.

Provenance

The following attestation bundles were made for plsautomate_runtime-0.0.3-py3-none-any.whl:

Publisher: workflow.yml on JannisConen/plsautomate-runtime

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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