Skip to main content

Autotune Hook

Project description

Autotune Hook

Python hook for wrapping OpenRouter calls with AutoTune workflow policy.

from autotune_hook import AutotuneHook

hook = AutotuneHook(workflow="email-triage")

def call_openrouter(payload):
    return hook.openrouter_call(
        payload,
        lambda: openrouter_client.chat.completions.create(**payload),
    )

Decorator form:

@hook.openrouter()
def call_openrouter(**payload):
    return openrouter_client.chat.completions.create(**payload)

Configuration defaults to environment variables:

  • AUTOTUNE_ENDPOINT
  • AUTOTUNE_API_KEY
  • AUTOTUNE_WORKFLOW
  • AUTOTUNE_PROJECT
  • AUTOTUNE_ENVIRONMENT
  • AUTOTUNE_SESSION_ID
  • AUTOTUNE_USER_ID

The hook sends the OpenRouter request to AutoTune first. A JSON boolean response means shadow mode, so the wrapped provider call executes and its output is reported in the background. A non-boolean AutoTune response is returned directly.

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

autotune_hook-0.1.0.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

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

autotune_hook-0.1.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for autotune_hook-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9a8818eda88901be23070a33ac57b4a6647eec60421575f4a614d967342f4615
MD5 f04b10f80efa9472ff8f555244c8d64f
BLAKE2b-256 e3e8ba19ecd997de1b38091ad1005b64323ea03fb2295ab7ce38f6e971c09eae

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for autotune_hook-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8a2e1d9c2acf8cff54c79d4d2654579e8d88ec77256d4bf7149d103b5c6577a2
MD5 8520edc784795fc773c0b0c0a60e3781
BLAKE2b-256 2c4deebab6bd28d076b2778d199d78184c3c5f15646c23ed6ab55cd6626fc425

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