Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions studio/frontend/src/features/chat/api-provider-logo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0

import { cn } from "@/lib/utils";
import { DashboardSquare01Icon } from "@hugeicons/core-free-icons";
import { HugeiconsIcon } from "@hugeicons/react";

/**
* Registry logos live at `public/provider-logos/{provider_type}.{ext}` where `provider_type`
Expand Down Expand Up @@ -40,6 +42,14 @@ interface ApiProviderLogoProps {
* OpenAI's asset is black-on-transparent; it is inverted in dark mode for contrast.
*/
export function ApiProviderLogo({ providerType, className, title }: ApiProviderLogoProps) {
if (providerType === "custom") {
return (
<span title={title} aria-hidden className="inline-flex shrink-0">
<HugeiconsIcon icon={DashboardSquare01Icon} className={cn("shrink-0", className)} />
</span>
);
}

const src = apiProviderLogoSrc(providerType);
if (!src) return null;
return (
Expand Down
6 changes: 5 additions & 1 deletion studio/frontend/src/features/chat/api/chat-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,10 @@ export function createOpenAIStreamAdapter(): ChatModelAdapter {

try {
const { supportsReasoning, reasoningEnabled } = runtime;
const externalBackendProviderType =
externalProvider?.providerType === "custom"
? "openai"
: externalProvider?.providerType;
const buildRequestPayload = async (forceRefreshPublicKey = false) =>
isExternalRequest
? {
Expand All @@ -653,7 +657,7 @@ export function createOpenAIStreamAdapter(): ChatModelAdapter {
max_tokens: params.maxTokens,
presence_penalty: params.presencePenalty,
provider_id: externalProvider?.id,
provider_type: externalProvider?.providerType,
provider_type: externalBackendProviderType,
external_model: externalSelection.modelId,
encrypted_api_key: await encryptProviderApiKey(
externalApiKey,
Expand Down
Loading