Skip to main content

Drop-in OpenAI SDK shim for EvalOps llm-gateway routing

Project description

evalops-openai

Drop-in OpenAI SDK shim for routing OpenAI-compatible requests through EvalOps llm-gateway with organization scope, principal attribution, audit, metering, and governance hooks.

This package wraps the official OpenAI SDKs instead of reimplementing OpenAI wire formats, so teams can route model calls through EvalOps with minimal code changes.

Python

pip install evalops-openai
from evalops_openai import OpenAI

client = OpenAI(
    organization_id="org_123",
    principal="user:ada@example.com",
)

response = client.chat.completions.create(
    **client.with_provider_ref(
        {
            "model": "gpt-4.1-mini",
            "messages": [{"role": "user", "content": "hello"}],
        }
    )
)

Node

npm install @evalops/openai
import { OpenAI } from "@evalops/openai";

const client = new OpenAI({
  organizationId: "org_123",
  principal: "user:ada@example.com",
});

const response = await client.chat.completions.create(
  client.withProviderRef({
    model: "gpt-4.1-mini",
    messages: [{ role: "user", content: "hello" }],
  }),
);

Environment

  • EVALOPS_API_KEY or OPENAI_API_KEY: Platform-issued bearer token.
  • EVALOPS_ORGANIZATION_ID: organization scope stamped into gateway requests.
  • EVALOPS_PRINCIPAL: optional actor string for audit attribution.
  • EVALOPS_TRACE_ID: optional trace correlation ID.
  • EVALOPS_LLM_GATEWAY_URL: EvalOps LLM gateway base URL.
  • EVALOPS_PROVIDER_ENVIRONMENT: defaults to prod.
  • EVALOPS_PROVIDER_CREDENTIAL_NAME: optional provider ref credential name.
  • EVALOPS_PROVIDER_TEAM_ID: optional provider ref team ID.

Provider References

Use with_provider_ref or withProviderRef when a request should select a specific provider credential. Organizations with default provider routing can omit the helper and keep the vendor SDK call shape.

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

evalops_openai-0.3.0.tar.gz (22.9 kB view details)

Uploaded Source

Built Distribution

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

evalops_openai-0.3.0-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file evalops_openai-0.3.0.tar.gz.

File metadata

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

File hashes

Hashes for evalops_openai-0.3.0.tar.gz
Algorithm Hash digest
SHA256 8b3d7eb8f09e0345a76f1066bd58dd615b7283e588a80ccef4b49d30f46268ee
MD5 68c63cd41ff62600a0c86763791167bb
BLAKE2b-256 d5c3bc64f0d02a9331808c9a2f6191dd41f3bd7c498c1276500db2da7ea39fa4

See more details on using hashes here.

Provenance

The following attestation bundles were made for evalops_openai-0.3.0.tar.gz:

Publisher: publish.yml on evalops/evalops-openai

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

File details

Details for the file evalops_openai-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: evalops_openai-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for evalops_openai-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 47ac5bda311b32f4af2ad19aa08152de85adb838633e15c2a1332a361c800704
MD5 d7315d4be459697347ff6580ab4104fd
BLAKE2b-256 57f4953ef7005f74c167a94d10d5738c103fb616a70ccc96af092ec001557878

See more details on using hashes here.

Provenance

The following attestation bundles were made for evalops_openai-0.3.0-py3-none-any.whl:

Publisher: publish.yml on evalops/evalops-openai

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