The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
from typing import Final
from integration._support.client import Gateway
from integration.cost_calculation.bridge_cost_parity.case import BridgeCostParityTestCase
from integration.cost_calculation.stream_parity.runner import bill_legs
def assert_bridge_cost_parity(case: BridgeCostParityTestCase, gateway: Gateway) -> None:
billed: Final = bill_legs(case.id, (case.native, case.bridged), gateway)
native: Final = billed[case.native.name].model_dump(include=set(case.compared_row_fields))
bridged: Final = billed[case.bridged.name].model_dump(include=set(case.compared_row_fields))
assert bridged == native, (case.id, billed[case.native.name], billed[case.bridged.name])