Skip to content

Feature/add hpc ai provider#5651

Open
lioZ129 wants to merge 8 commits intoHelicone:mainfrom
lioZ129:feature/add-hpc-ai-provider
Open

Feature/add hpc ai provider#5651
lioZ129 wants to merge 8 commits intoHelicone:mainfrom
lioZ129:feature/add-hpc-ai-provider

Conversation

@lioZ129
Copy link
Copy Markdown

@lioZ129 lioZ129 commented Apr 1, 2026

Ticket

N/A — internal HPC-AI gateway integration

Component/Service

What part of Helicone does this affect?

  • Web (Frontend)
  • Jawn (Backend)
  • Worker (Proxy)
  • Bifrost (Marketing)
  • AI Gateway
  • Packages
  • Infrastructure/Docker
  • Documentation

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Performance improvement
  • Refactoring

Deployment Notes

  • No special deployment steps required
  • Database migrations need to run
  • Environment variable changes required
  • Coordination with other teams needed

Worker: deploy Cloudflare Worker as usual; no new secrets required for basic routing unless you add HPC-AI-specific config later.

Screenshots / Demos

Before After
HPC-AI not listed as a gateway/provider option HPC-AI appears in provider UI, docs, and gateway routing for supported models

Extra Notes

  • Gateway: OpenAI-compatible base https://api.hpc-ai.com/inference/v1; worker builds targets with the /inference path prefix where needed.
  • Models: kimi-k2.5/hpcai, minimax-m2.5/hpcai — cost/registry entries and worker registry tests cover routing and BYOK-style auth expectations.
  • Generated types: web / bifrost jawnTypes, helicone-mcp public.ts, and docs/swagger.json are updated with minimal enum-only diffs (HPC_AI / hpcai) to avoid full OpenAPI regeneration churn.
  • Cost layout: MiniMax-on-HPC-AI lives under packages/cost/models/authors/hpcai-hosted/ so we don’t introduce a separate authors/minimax tree; Kimi HPC-AI endpoint remains under Moonshot author endpoints.
  • Tests: HPC-AI gateway cases live in worker/test/ai-gateway/registry-hpcai.spec.ts (Moonshot registry spec left unchanged aside from any upstream baseline).

Context

Helicone users who run models through HPC-AI’s OpenAI-compatible API need first-class provider support: correct proxy routing, cost/registry metadata, dashboard/provider labeling, and documentation so requests are logged and attributed consistently with other gateway providers.

Copilot AI review requested due to automatic review settings April 1, 2026 09:08
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 1, 2026

@lioZ129 is attempting to deploy a commit to the Helicone Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds first-class HPC-AI gateway/provider support across the worker gateway routing, cost/model registry, UI/provider metadata, and docs so HPC-AI OpenAI-compatible requests can be routed, labeled, and priced consistently.

Changes:

  • Add hpcai.helicone.ai gateway routing and registry tests for HPC-AI models.
  • Extend cost/model provider registry + usage processing to recognize HPC_AI / hpcai.
  • Update UI provider lists, generated types, and docs to surface HPC-AI integration.

Reviewed changes

Copilot reviewed 37 out of 38 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
worker/wrangler.toml Add hpcai custom domain route
worker/test/setup.ts Mock provider creds for tests
worker/test/ai-gateway/registry-hpcai.spec.ts Add HPC-AI routing tests
worker/src/routers/gatewayRouter.ts Fix/adjust gateway provider selection
worker/src/lib/clients/ProviderClient.ts Update target URL construction
worker/src/index.ts Route hpcai subdomain to target
web/public/assets/home/providers/hpc-ai.svg Add HPC-AI provider logo
web/lib/clients/jawnTypes/public.ts Add HPC_AI / hpcai enums
web/lib/clients/jawnTypes/private.ts Add HPC_AI / hpcai enums
web/data/providers.ts Add HPC-AI provider metadata
web/components/templates/wrapped/sections/RequestSpotlightSection.tsx Display name mapping for HPC_AI
web/components/templates/wrapped/sections/FavoriteProvidersSection.tsx Display name/logo for HPC_AI
web/components/templates/requests/colors.ts Color mapping for HPC_AI/hpcai/minimax
valhalla/jawn/src/tsoa-build/public/swagger.json Public OpenAPI enum updates
valhalla/jawn/src/tsoa-build/public/routes.ts Public tsoa enum updates
valhalla/jawn/src/tsoa-build/private/swagger.json Private OpenAPI enum updates
valhalla/jawn/src/tsoa-build/private/routes.ts Private tsoa enum updates
README.md Document HPC-AI integration entry
packages/cost/usage/getUsageProcessor.ts Add hpcai usage processor mapping
packages/cost/providers/mappings.ts Recognize api.hpc-ai.com provider
packages/cost/models/types.ts Add minimax author
packages/cost/models/registry.ts Register HPC-AI hosted models/endpoints
packages/cost/models/providers/priorities.ts Add hpcai provider priority
packages/cost/models/providers/index.ts Register HpcAiProvider
packages/cost/models/providers/hpcai.ts New provider implementation
packages/cost/models/provider-helpers.ts Map HPC-AI provider names
packages/cost/models/authors/moonshotai/kimi-k2.5/endpoints.ts Add kimi-k2.5:hpcai endpoint
packages/cost/models/authors/hpcai-hosted/minimax-m2.5/models.ts Add minimax-m2.5 model config
packages/cost/models/authors/hpcai-hosted/minimax-m2.5/endpoints.ts Add minimax-m2.5:hpcai endpoint
packages/cost/models/authors/hpcai-hosted/index.ts Export HPC-AI hosted registry bundle
helicone-mcp/src/types/public.ts Add HPC_AI / hpcai enums
docs/swagger.json Docs OpenAPI enum updates
docs/snippets/approved-domains.mdx Add HPC-AI approved domain row
docs/getting-started/integration-method/hpc-ai.mdx New HPC-AI integration doc
docs/getting-started/integration-method/gateway.mdx Add HPC-AI gateway table row
docs/docs.json Add HPC-AI page to sidebar
bifrost/lib/clients/jawnTypes/public.ts Add HPC_AI / hpcai enums
bifrost/lib/clients/jawnTypes/private.ts Add HPC_AI / hpcai enums

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 176 to 188
export function buildTargetUrl(originalUrl: URL, apiBase: string): URL {
const apiBaseUrl = new URL(apiBase.replace(/\/$/, ""));
const trimmedBase = apiBase.replace(/\/$/, "");
const apiBaseUrl = new URL(trimmedBase);
let basePath = apiBaseUrl.pathname;
if (basePath === "/" || basePath === "") {
basePath = "";
} else {
basePath = basePath.replace(/\/$/, "");
}

return new URL(
`${apiBaseUrl.origin}${originalUrl.pathname}${originalUrl.search}`
`${apiBaseUrl.origin}${basePath}${originalUrl.pathname}${originalUrl.search}`
);
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

buildTargetUrl now prepends apiBaseUrl.pathname to originalUrl.pathname. If apiBase already includes the same path segment as the incoming request (e.g., firecrawl targets currently include /v0/scrape while requests likely hit /v0/scrape), this can produce duplicated paths like /v0/scrape/v0/scrape and break routing. Consider guarding against duplication (e.g., only prefix basePath when originalUrl.pathname doesn’t already start with it) or ensure all GATEWAY_TARGET values remain origin-only except for true prefix cases like /inference.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

lioZ129 and others added 2 commits April 1, 2026 17:17
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants