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.2.2.tar.gz (22.4 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.2.2-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for evalops_openai-0.2.2.tar.gz
Algorithm Hash digest
SHA256 6062203bdb985e3d7747aada4af799bf105cc843874f9c6edf894633b0656609
MD5 4878a9c0321180b019c8c9240366a285
BLAKE2b-256 3af24e59485e98d308fa7cdbdee687cb4cde64c145275b965df8150997ac9138

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for evalops_openai-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f3292474cf79c6c2628b2f2a2b1cabf637c2264e27bb9301851113c09ea4b184
MD5 875a704c921bc4ee3f7dc1d50d83865b
BLAKE2b-256 0e983917d425b2b1d634e7b5d428ef7b114c7dfef7b50806aceb35be7976049c

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