maxim & bifrost

on this page

bifrost#

i joined early, before stable v1 and i've stayed on the core team since, shipping across pretty much every layer — provider integrations, realtime, the compat plugin, billing, config storage, observability and the test infrastructure. this is what i've mostly worked on:

providers#

  • new providers: aws sagemaker, elevenlabs (speech + transcription), github copilot, groq, openrouter and deepseek.
  • sagemaker: chat and responses goes through sagemaker's openai-compatible routes. also added a sigv4-signed passthrough for InvokeEndpoint and response streaming, which unwraps aws event-stream framing so the container's own format reaches the client unchanged.
  • github copilot: added pat token and oauth device flow authentication. claude models now go to copilot's native /v1/messages, codex models to /responses, and embeddings are supported.
  • anthropic-compatible apis for deepseek, fireworks and sglang (set per key), plus anthropic files api support (file_id references, content-type forwarding).
  • vllm & sglang: moved vllm to the native responses api, fixed stream truncation and token usage under --skip-pipeline, replayed reasoning blocks correctly, and added native decision requests (/v1/systemone) for both.
  • multi-deployment: changed ollama and sglang from one base url per provider to one per key, so you can load-balance across local instances serving different models.
  • azure model router, bedrock mantle and vertex: cost calculation, support for vertex self hosted models and usage tracking plus model-name normalization for anthropic models on vertex.

logs dashboard

realtime#

  • bedrock nova sonic: clients speak the openai realtime protocol and bifrost translates it to and from nova sonic's bidirectional stream — session config, conversation items, audio, tool calls and turn handling.
  • realtime connectors: nova sonic is a signed http/2 event stream, not a websocket, so i added a connector interface that lets a provider bring its own transport. the realtime handler relays through it like any websocket provider.

multimodal embeddings#

before 2.3.0, embeddings in bifrost were text-only.

  • one input shape: each entry in input can be a list of typed parts (text, image, audio, video, file, tokens) that produces one vector. old string and token inputs go out on the wire exactly as before.
  • per-item params: each entry can override request params like task_type or dimensions. only gemini's :batchEmbedContents can honour that, so every other provider returns a 400 naming the item instead of silently ignoring the override.
  • labelled responses: vectors carry their modality, video_segment time ranges and encoding_format. base64 works everywhere — bifrost encodes it in openai's layout when the model can't.
  • new models: gemini embedding 2 (audio, video and pdfs) on gemini and vertex, vertex multimodalembedding@001 (a vector per modality, video sliced into timed segments), cohere embed v4 images, bedrock titan multimodal, amazon nova 2 multimodal (inline or s3://), and parasail.
  • native dialects: the genai :embedContent / :batchEmbedContents, /cohere/v2/embed and bedrock invoke routes round-trip these models, so existing google and cohere sdks keep working against any provider.
  • the logs ui shows embedding inputs.

litellm → bifrost migration#

built the migration tool for teams moving off litellm. it reads litellm's database directly and maps models, virtual keys, users, teams and orgs to their bifrost equivalents.

billing & cost accuracy#

  • batch api pricing: added a background sweeper that waits for batches to settle, then trigger pricing and governance enforment. batches with multiple models are supported.
  • web search pricing: added tool_usage to usage and price web search per request from the count providers report, replacing per-query pricing. existing logs and pricing overrides are migrated so they can still be repriced.
  • prompt cache ttls: openai's 12h cache breakpoints are forwarded where they're accepted and stripped where they'd 400. 30m and 12h cache writes are tracked separately and 12h writes are priced by service tier and context size.
  • served-model billing: when deepseek quietly serves a newer model than the one requested, cost and routing now use the model that was actually served.
  • streaming cost fixes: image generation/edit streams, and pricing overrides set on a virtual key or provider key that weren't being applied to streamed responses.

config & storage#

  • encryption backfill deadlock: when several nodes booted against the same postgres, their startup encryption passes locked rows in opposite orders and deadlocked, and offset pagination skipped or repeated rows while they were being updated. fixed it with one transaction and one row lock per row, cursor-based pagination and concurrent vault writes, and tested it with multiple nodes running against postgres.
  • plugin config sync: replaced version-based plugin merging with sha-256 hashes of each plugin's config.json entry. if the file is unchanged, edits made in the ui or api survive restarts; if it changed, the file wins. older rows get a hash added on first boot.

compat plugin#

this is the layer that makes "any client, any provider" actually work. it roughly does this:

  • request-type conversion: if a model doesn't support the endpoint a client called, the request is converted (say chat → responses), sent to the model, and the response converted back. streaming works by doing the same thing per chunk.
  • datasheet-driven param dropping: unsupported parameters are dropped or converted per model, based on bifrost's datasheet. most compatibility fixes now ship as a datasheet update instead of a release, and older gateways stay compatible longer. every drop or conversion is logged, so it's never silent.
  • coding harness support: codex compatibility (namespaced tools, replaying encrypted assistant content and reasoning item ids) and claude code fixes (empty thinking blocks, trailing assistant messages).
  • azure deepseek: on azure, deepseek's responses endpoint rejects reasoning.effort and its chat endpoint doesn't support web search, so requests from claude code, codex, cursor and opencode go through chat completions while everyone else stays on responses.
  • newer tool types: openai's shell and apply_patch tools, gemini code execution on the responses api, openai- and anthropic-style computer tools, and translating allowed_callers between anthropic's versioned caller names and openai's "programmatic".
  • prompt caching: cache_control on chat tool calls for anthropic and bedrock, a per-model check for whether cache breakpoints are supported, a cap of four markers for claude on openrouter, and bedrock cachePoint markers removed for other providers but kept for fallbacks.
  • reasoning across providers: dropping reasoning when a model can't handle it, disabling deepseek's thinking under tool_choice: required, carrying summary text and signatures through anthropic / bedrock / gemini reasoning streams, emitting anthropic thinking deltas from raw reasoning text, and working out finish_reason from the responses api's final state.
  • a long tail of per-provider quirks: leaked dsml tags and rejected stop sequences from deepseek v3.2 on bedrock, the anthropic-only safeguards param on databricks, gemini function names and ids over 64 characters, thinking blocks in mistral streams, reasoning_content on groq and cerebras, mistral's reasoning effort values.

observability#

  • multiple otel collector profiles — send traces and metrics to several destinations at once (datadog, langfuse, prometheus, etc).
  • logs ui — time-based filtering and deletion, the model the provider actually served, cached vs uncached input token breakdowns, and embedding inputs.
  • agent-name and correlation-id filters for warp's logs tools.

testing & infra#

wrote a large share of bifrost's test suites — playwright e2e tests for providers, virtual keys, mcp oauth, the mcp registry and github copilot sign-in (and rbac, guardrails and access profiles on enterprise), a refactor of the e2e ui suite, the realtime suite, and azure / bedrock / vertex / batch / embedding cases in the provider test harness. also cleaned up the helm values schema and wrote docs for sagemaker, nova sonic realtime, codex, github copilot, openwebui, cohere and azure model router.


maxim#

maxim is an ai observability and evaluation platform — logging, tracing, evals, test runs, prompt management, and simulations for teams building on LLMs. i have worked across the whole stack — the main platform (next.js monorepo on Nx), and both Python and JS/TS SDKs.

internal bifrost deployment#

maintains internal bifrost instance that powers maxim's ai layer. it allows us to do things like:

  • BYOK (bring your own key), provide provider-specific configs (like vertex's regions, bedrock arn, etc.), multiple deployments for Ollama and vLLM.
  • provider and model discovery — maxim supports 1000+ models, across 20+ providers.
  • inference, voice simulations, and streaming all go through bifrost.

human & retro evals#

external human raters on log repositories, a variable catalog for evaluator suggestions, and the human-eval sheet/table UI (annotation forms, comparison views, xlsx export for human evaluations in test runs).

logging pipeline#

consolidated the logging surface into a single logging API, added a LogLine class in the JS SDK for manually pushing logs, and fixed a nasty bug where multiple Maxim SDK instances on the same API key stepped on each other.

added the LogLine apis to collect log lines and push them to the logging apis. this gives client ownership of the log export process.

kept both SDKs in lockstep — prompt id / prompt version passthrough, variable mapping, withLogger/with_logger for logging on prompt runs, streaming fixes for the agno integration (python), and making sure a broken log-repository connection doesn't block logger creation.

prompts, evaluator, simulation apis#

built out a big chunk of the public API surface — prompt tools, prompt versions v2, prompt deployment by version number, prompt partials, and model / evaluator management apis. Also shipped variable mapping for SDK test runs and prompt-version fallback logic when creating new versions.

ui work#

  • session table improvements (tool-call display, saved search, tooltips for cost / tokens / prompt versions)
  • drag-to-reorder and filtering in trace and session tables
  • dataset split search and migration fixes
  • dashboard and email-template fixes and a long tail of UI bugfixes (dropdown state, title race conditions, drag-and-drop, rich text handling).