Skip to content

feat: Kimi/Moonshot partnership promotion POC#369

Open
felarof99 wants to merge 3 commits intomainfrom
feat/kimi-poc
Open

feat: Kimi/Moonshot partnership promotion POC#369
felarof99 wants to merge 3 commits intomainfrom
feat/kimi-poc

Conversation

@felarof99
Copy link
Contributor

Summary

  • Add Moonshot / Kimi as the first quick provider template in LLM Providers settings, pre-configured with Moonshot API (https://api.moonshot.ai/v1, model kimi-k2-0905-preview)
  • Add "Free model Sponsored by Kimi K2.5" promotional badge on the BrowserOS built-in provider card
  • Add Kimi at the top of LLM Chat & Hub with orange glow ring and "Try Kimi" badge
  • Register moonshot as a recognized provider type across shared schema, all 3 server provider factories, and frontend

Design

Moonshot API is OpenAI-compatible, so the server uses createOpenAICompatible for the factory — no new adapter code. Frontend changes add moonshot to the ProviderType union, provider templates, icons (using Kimi from @lobehub/icons), models data, and form schema. The promotional styling uses existing --accent-orange CSS variables and Tailwind utilities.

13 files changed across packages/shared, apps/server, and apps/agent.

Test plan

  • Build the agent extension and verify "Moonshot / Kimi" appears as first template in LLM Providers settings
  • Click "USE" on the Kimi template → verify form pre-fills with Moonshot API URL and kimi-k2-0905-preview model
  • Verify "Free model Sponsored by Kimi K2.5" badge shows on the BrowserOS provider card
  • Navigate to LLM Chat & Hub → verify Kimi is at the top with orange glow and "Try Kimi" badge
  • Test provider connection with a valid Moonshot API key
  • Server typecheck passes (bun run --filter @browseros/server typecheck)

🤖 Generated with Claude Code

felarof99 and others added 2 commits February 26, 2026 16:50
Add Moonshot/Kimi as a first-class provider template with promotional
UI treatment across LLM Providers and LLM Chat & Hub settings pages.

- Add 'moonshot' provider type to shared schema, server adapter, and frontend
- Add Kimi template as first quick provider template (Moonshot API endpoint)
- Add "Free model Sponsored by Kimi K2.5" badge on BrowserOS provider card
- Add Kimi at top of LLM Hub defaults with orange glow and "Try Kimi" badge

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Review caught two additional PROVIDER_FACTORIES records missing
the moonshot mapping — the SDK LLM client and agent tool-loop
paths would have thrown "Unknown provider" at runtime.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 27, 2026

Greptile Summary

This PR adds Moonshot/Kimi as a partnership promotion across the BrowserOS agent. The implementation consistently adds moonshot as a new provider type across all layers (shared schemas, server factories, and frontend). Moonshot uses OpenAI-compatible API, so no new adapter code is needed.

Key changes:

  • Moonshot/Kimi positioned as first provider template in LLM settings
  • "Free model Sponsored by Kimi K2.5" badge on BrowserOS provider card
  • Kimi promoted at top of LLM Hub with orange glow ring and "Try Kimi" badge
  • Server implementations added to all 3 provider factory locations (provider-adapter, tool-loop, llm client)

Minor concern:

  • LLM Hub uses hardcoded name check for promotional styling, which is fragile if users edit the provider name

Confidence Score: 4/5

  • This PR is safe to merge with minimal risk
  • Implementation is straightforward and consistent across all files. The moonshot provider reuses existing OpenAI-compatible adapter pattern, minimizing risk. Minor style concern with hardcoded name check in LLM Hub doesn't affect core functionality.
  • No files require special attention - all changes follow established patterns

Important Files Changed

Filename Overview
apps/agent/entrypoints/app/llm-hub/HubProviderRow.tsx Adds Kimi promotional styling (orange glow ring and "Try Kimi" badge) using hardcoded name check
apps/agent/entrypoints/app/ai-settings/ProviderCard.tsx Adds sponsorship badge to BrowserOS provider card with correct type check
apps/agent/lib/llm-providers/providerTemplates.ts Added Moonshot/Kimi as first provider template with API URL and default model
packages/shared/src/schemas/llm.ts Added moonshot to LLM provider schema constants and enum
apps/server/src/agent/provider-adapter/index.ts Added createMoonshotFactory using OpenAI-compatible adapter

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[User opens LLM Settings] --> B{Selects Provider}
    B -->|New Provider| C[NewProviderDialog]
    C --> D[moonshot first in providerTypeEnum]
    C --> E[Select Moonshot/Kimi template]
    E --> F[Pre-fills API URL & model]
    
    B -->|Existing Provider| G[ProviderCard]
    G -->|BrowserOS provider| H{Check provider.type}
    H -->|type === 'browseros'| I[Show Kimi K2.5 sponsorship badge]
    
    J[User opens LLM Hub] --> K[Load DEFAULT_PROVIDERS]
    K --> L[Kimi at top of list]
    L --> M[HubProviderRow]
    M -->|Check provider.name| N{name === 'Kimi'?}
    N -->|Yes| O[Apply orange glow + Try Kimi badge]
    N -->|No| P[Standard styling]
    
    Q[Server receives request] --> R{Provider type?}
    R -->|moonshot| S[createMoonshotFactory]
    S --> T[createOpenAICompatible]
    T --> U[Vercel AI SDK]
    
    style D fill:#ff9800
    style I fill:#ff9800
    style O fill:#ff9800
    style S fill:#ff9800
Loading

Last reviewed commit: 7579aff

Copy link
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.

13 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment on lines 80 to 84
{isBuiltIn && (
<span className="mb-1 inline-block rounded-full bg-gradient-to-r from-orange-500 to-amber-500 px-3 py-0.5 font-semibold text-white text-xs">
Free model Sponsored by Kimi K2.5
</span>
)}
Copy link
Contributor

Choose a reason for hiding this comment

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

Badge shows for ALL built-in providers, but PR description says it should only show "on the BrowserOS built-in provider card". Need to check provider.type === 'browseros' instead of just isBuiltIn.

Suggested change
{isBuiltIn && (
<span className="mb-1 inline-block rounded-full bg-gradient-to-r from-orange-500 to-amber-500 px-3 py-0.5 font-semibold text-white text-xs">
Free model Sponsored by Kimi K2.5
</span>
)}
{isBuiltIn && provider.type === 'browseros' && (
<span className="mb-1 inline-block rounded-full bg-gradient-to-r from-orange-500 to-amber-500 px-3 py-0.5 font-semibold text-white text-xs">
Free model Sponsored by Kimi K2.5
</span>
)}
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/agent/entrypoints/app/ai-settings/ProviderCard.tsx
Line: 80-84

Comment:
Badge shows for ALL built-in providers, but PR description says it should only show "on the BrowserOS built-in provider card". Need to check `provider.type === 'browseros'` instead of just `isBuiltIn`.

```suggestion
        {isBuiltIn && provider.type === 'browseros' && (
          <span className="mb-1 inline-block rounded-full bg-gradient-to-r from-orange-500 to-amber-500 px-3 py-0.5 font-semibold text-white text-xs">
            Free model Sponsored by Kimi K2.5
          </span>
        )}
```

How can I resolve this? If you propose a fix, please make it concise.

Address Greptile review: add explicit provider.type check
to ensure badge only renders for the BrowserOS provider.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant