Conversation
|
@lioZ129 is attempting to deploy a commit to the Helicone Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
There was a problem hiding this comment.
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.aigateway 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.
| 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}` | ||
| ); |
There was a problem hiding this comment.
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.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Ticket
N/A — internal HPC-AI gateway integration
Component/Service
What part of Helicone does this affect?
Type of Change
Deployment Notes
Worker: deploy Cloudflare Worker as usual; no new secrets required for basic routing unless you add HPC-AI-specific config later.
Screenshots / Demos
Extra Notes
https://api.hpc-ai.com/inference/v1; worker builds targets with the/inferencepath prefix where needed.kimi-k2.5/hpcai,minimax-m2.5/hpcai— cost/registry entries and worker registry tests cover routing and BYOK-style auth expectations.web/bifrostjawnTypes,helicone-mcppublic.ts, anddocs/swagger.jsonare updated with minimal enum-only diffs (HPC_AI/hpcai) to avoid full OpenAPI regeneration churn.packages/cost/models/authors/hpcai-hosted/so we don’t introduce a separateauthors/minimaxtree; Kimi HPC-AI endpoint remains under Moonshot author endpoints.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.