Skip to content

โœจ feat: add v0 (Vercel) provider support #8235

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jun 20, 2025

Conversation

hezhijie0327
Copy link
Contributor

@hezhijie0327 hezhijie0327 commented Jun 20, 2025

๐Ÿ’ป ๅ˜ๆ›ด็ฑปๅž‹ | Change Type

  • โœจ feat
  • ๐Ÿ› fix
  • โ™ป๏ธ refactor
  • ๐Ÿ’„ style
  • ๐Ÿ‘ท build
  • โšก๏ธ perf
  • ๐Ÿ“ docs
  • ๐Ÿ”จ chore

๐Ÿ”€ ๅ˜ๆ›ด่ฏดๆ˜Ž | Description of Change

  1. ๅขžๅŠ  v0 (Vercel) ๆไพ›ๅ•†
  2. ้€‚้…ๆไพ›ๅ•†ๅŠๆจกๅž‹ๅ›พๆ ‡ ๐Ÿ’„ style: support v0 (Vercel) provider & model iconsย lobe-icons#124
  3. ้€‚้… ModelFetch

Screenshot
image

Note:
ๆŒ‰็…ง v0 ๆจกๅž‹ไป‹็ป้กต้ข๏ผŒๅบ•ๅฑ‚ๆจกๅž‹ๅฏน็…งๅฆ‚ไธ‹๏ผš

v0 Models Base Models
v0-1.0-md Sonnet 3.7
v0-1.5-md Sonnet 4
v0-1.5-lg Sonnet 4

image


Model Fetch:

{
  "object": "list",
  "data": [
    {
      "id": "v0-1.0-md",
      "object": "model",
      "created": 1747843882,
      "owned_by": "vercel"
    },
    {
      "id": "v0-1.5-md",
      "object": "model",
      "created": 1748873425,
      "owned_by": "vercel"
    },
    {
      "id": "v0-1.5-lg",
      "object": "model",
      "created": 1748873425,
      "owned_by": "vercel"
    }
  ]
}

๐Ÿ“ ่กฅๅ……ไฟกๆฏ | Additional Information

discussion: #6157 (comment)

ref: https://vercel.com/blog/v0-composite-model-family
ref: https://vercel.com/docs/v0/api#models
ref: https://vercel.com/docs/v0/api#api-reference
ref: https://v0.dev/pricing

Summary by Sourcery

Add end-to-end support for the Vercel v0 API as an LLM provider by updating configuration schemas, Docker environments, UI components, model catalogs, type definitions, and runtime integration

New Features:

  • Add Vercel (v0) as a new LLM provider with model catalog, provider card, and runtime implementation

Enhancements:

  • Include VercelProviderCard in the provider selection UI
  • Extend LLM configuration and type definitions to support Vercel

Build:

  • Expose VERCEL_API_KEY and VERCEL_MODEL_LIST environment variables in Dockerfiles

Summary by Sourcery

Add end-to-end support for the Vercel v0 API as a new LLM provider

New Features:

  • Create v0 model definitions and include them in the default AI model catalog
  • Add V0 provider card to the UI and include it in the provider selection list
  • Implement LobeV0AI runtime integration using the OpenAI-compatible factory

Enhancements:

  • Extend configuration schemas, types, and the ModelProvider enum to support V0 API keys
  • Update runtime map and key vault interfaces to recognize the V0 provider

Build:

  • Expose V0_API_KEY and V0_MODEL_LIST environment variables in Dockerfiles

Copy link

vercel bot commented Jun 20, 2025

@hezhijie0327 is attempting to deploy a commit to the LobeHub Community Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

sourcery-ai bot commented Jun 20, 2025

Reviewer's Guide

This PR adds end-to-end support for the Vercel v0 provider by updating configuration schemas, environment variables, UI components, model catalogs, type definitions, and runtime integration to register and operate V0 alongside existing providers.

Entity relationship diagram for Vercel v0 provider configuration and models

erDiagram
  LLMConfig {
    boolean ENABLED_V0
    string V0_API_KEY
  }
  DockerEnv {
    string V0_API_KEY
    string V0_MODEL_LIST
  }
  UserKeyVaults {
    OpenAICompatibleKeyVault v0
  }
  V0Provider {
    string id
    string name
    string description
    string url
    string modelsUrl
  }
  v0ChatModels {
    string id
    string displayName
    string description
    int contextWindowTokens
    int maxOutput
    object abilities
    object pricing
    string type
  }

  V0Provider ||--o{ v0ChatModels : provides
  LLMConfig ||--|| DockerEnv : mirrors
  UserKeyVaults ||--|| V0Provider : uses
Loading

File-Level Changes

Change Details Files
Extend LLM configuration and environment setup for V0
  • Add ENABLED_V0 and V0_API_KEY to runtimeEnv and schema
  • Expose V0_API_KEY and V0_MODEL_LIST in Dockerfiles
  • Include v0 key vault in user settings types
src/config/llm.ts
Dockerfile
src/types/user/settings/keyVaults.ts
Integrate V0 provider into model provider lists and UI
  • Register V0Provider in default provider and model lists
  • Import and export V0ProviderCard in provider index
  • Include V0ProviderCard in the settings UI provider list
src/config/modelProviders/index.ts
src/app/[variants]/(main)/settings/llm/ProviderList/providers.tsx
Add V0 AI model catalog
  • Create v0.ts defining v0ChatModels entries
  • Include v0 export in aiModels index
src/config/aiModels/v0.ts
src/config/aiModels/index.ts
Implement V0 runtime integration
  • Add ModelProvider.V0 enum entry
  • Map v0 to LobeV0AI in runtimeMap
  • Define LobeV0AI via openaiCompatibleFactory
src/libs/model-runtime/types/type.ts
src/libs/model-runtime/runtimeMap.ts
src/libs/model-runtime/v0/index.ts

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@lobehubbot
Copy link
Member

๐Ÿ‘ @hezhijie0327

Thank you for raising your pull request and contributing to our Community
Please make sure you have followed our contributing guidelines. We will review it as soon as possible.
If you encounter any problems, please feel free to connect with us.
้žๅธธๆ„Ÿ่ฐขๆ‚จๆๅ‡บๆ‹‰ๅ–่ฏทๆฑ‚ๅนถไธบๆˆ‘ไปฌ็š„็คพๅŒบๅšๅ‡บ่ดก็Œฎ๏ผŒ่ฏท็กฎไฟๆ‚จๅทฒ็ป้ตๅพชไบ†ๆˆ‘ไปฌ็š„่ดก็ŒฎๆŒ‡ๅ—๏ผŒๆˆ‘ไปฌไผšๅฐฝๅฟซๅฎกๆŸฅๅฎƒใ€‚
ๅฆ‚ๆžœๆ‚จ้‡ๅˆฐไปปไฝ•้—ฎ้ข˜๏ผŒ่ฏท้šๆ—ถไธŽๆˆ‘ไปฌ่”็ณปใ€‚

Copy link

codecov bot commented Jun 20, 2025

Codecov Report

Attention: Patch coverage is 96.03960% with 4 lines in your changes missing coverage. Please review.

Project coverage is 87.88%. Comparing base (88c4362) to head (1e85772).
Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
src/libs/model-runtime/v0/index.ts 69.23% 4 Missing โš ๏ธ
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8235      +/-   ##
==========================================
- Coverage   95.67%   87.88%   -7.80%     
==========================================
  Files          14      839     +825     
  Lines        2522    62456   +59934     
  Branches      445     3936    +3491     
==========================================
+ Hits         2413    54888   +52475     
- Misses        109     7568    +7459     
Flag Coverage ฮ”
app 87.88% <96.03%> (?)
server 95.67% <รธ> (รธ)

Flags with carried forward coverage won't be shown. Click here to find out more.

โ˜” View full report in Codecov by Sentry.
๐Ÿ“ข Have feedback on the report? Share it here.

๐Ÿš€ New features to boost your workflow:
  • โ„๏ธ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • ๐Ÿ“ฆ JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hezhijie0327 hezhijie0327 marked this pull request as ready for review June 20, 2025 07:57
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jun 20, 2025
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.

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

Copy link
Contributor

gru-agent bot commented Jun 20, 2025

TestGru Assignment

Summary

Link CommitId Status Reason
Detail 4320d97 ๐Ÿšซ Skipped No files need to be tested {"Dockerfile":"File path does not match include patterns.","Dockerfile.database":"File path does not match include patterns.","Dockerfile.pglite":"File path does not match include patterns.","src/app/[variants]/(main)/settings/llm/ProviderList/providers.tsx":"File path does not match include patterns.","src/config/aiModels/index.ts":"File path does not match include patterns.","src/config/aiModels/v0.ts":"File path does not match include patterns.","src/config/llm.ts":"File path does not match include patterns.","src/config/modelProviders/index.ts":"File path does not match include patterns.","src/config/modelProviders/v0.ts":"File path does not match include patterns.","src/libs/model-runtime/runtimeMap.ts":"File path does not match include patterns.","src/libs/model-runtime/types/type.ts":"File path does not match include patterns.","src/libs/model-runtime/v0/index.ts":"File path does not match include patterns.","src/types/user/settings/keyVaults.ts":"Fileโ€ฆ

History Assignment

Tip

You can @gru-agent and leave your feedback. TestGru will make adjustments based on your input

@dosubot dosubot bot added Model Provider ๆจกๅž‹ๆœๅŠกๅ•† ๐ŸŒ  Feature Request New feature or request | ็‰นๆ€งไธŽๅปบ่ฎฎ labels Jun 20, 2025
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @hezhijie0327 - I've reviewed your changes - here's some feedback:

  • V0ProviderCard.chatModels is currently empty โ€“ import and assign your v0ChatModels so the UI can display available models.
  • Either hook V0_MODEL_LIST into your configuration/runtime for dynamic model selection or remove it if it's not used.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- V0ProviderCard.chatModels is currently empty โ€“ import and assign your v0ChatModels so the UI can display available models.
- Either hook V0_MODEL_LIST into your configuration/runtime for dynamic model selection or remove it if it's not used.

## Individual Comments

### Comment 1
<location> `src/config/aiModels/v0.ts:14` </location>
<code_context>
+    description:
+      'v0-1.5-lg ๆจกๅž‹้€‚็”จไบŽ้ซ˜็บงๆ€่€ƒๆˆ–ๆŽจ็†ไปปๅŠก',
+    displayName: 'v0-1.5-lg',
+    enabled: true,
+    id: 'v0-1.5-lg',
+    maxOutput: 32_000,
</code_context>

<issue_to_address>
Missing 'enabled' property in the third model.

Consider adding the 'enabled' property to the third model for consistency and to prevent issues in code that expects this property.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them โœจ
Help me be more useful! Please click ๐Ÿ‘ or ๐Ÿ‘Ž on each comment and I'll use the feedback to improve your reviews.

description:
'v0-1.5-lg ๆจกๅž‹้€‚็”จไบŽ้ซ˜็บงๆ€่€ƒๆˆ–ๆŽจ็†ไปปๅŠก',
displayName: 'v0-1.5-lg',
enabled: true,
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: Missing 'enabled' property in the third model.

Consider adding the 'enabled' property to the third model for consistency and to prevent issues in code that expects this property.

Copy link

vercel bot commented Jun 20, 2025

The latest updates on your projects. Learn more about Vercel for Git โ†—๏ธŽ

Name Status Preview Comments Updated (UTC)
lobe-chat-preview โœ… Ready (Inspect) Visit Preview ๐Ÿ’ฌ Add feedback Jun 20, 2025 4:20pm

@arvinxx arvinxx merged commit 5842a18 into lobehub:main Jun 20, 2025
17 of 18 checks passed
@lobehubbot
Copy link
Member

โค๏ธ Great PR @hezhijie0327 โค๏ธ

The growth of project is inseparable from user feedback and contribution, thanks for your contribution! If you are interesting with the lobehub developer community, please join our discord and then dm @arvinxx or @canisminor1990. They will invite you to our private developer channel. We are talking about the lobe-chat development or sharing ai newsletter around the world.
้กน็›ฎ็š„ๆˆ้•ฟ็ฆปไธๅผ€็”จๆˆทๅ้ฆˆๅ’Œ่ดก็Œฎ๏ผŒๆ„Ÿ่ฐขๆ‚จ็š„่ดก็Œฎ! ๅฆ‚ๆžœๆ‚จๅฏน LobeHub ๅผ€ๅ‘่€…็คพๅŒบๆ„Ÿๅ…ด่ถฃ๏ผŒ่ฏทๅŠ ๅ…ฅๆˆ‘ไปฌ็š„ discord๏ผŒ็„ถๅŽ็งไฟก @arvinxx ๆˆ– @canisminor1990ใ€‚ไป–ไปฌไผš้‚€่ฏทๆ‚จๅŠ ๅ…ฅๆˆ‘ไปฌ็š„็งๅฏ†ๅผ€ๅ‘่€…้ข‘้“ใ€‚ๆˆ‘ไปฌๅฐ†ไผš่ฎจ่ฎบๅ…ณไบŽ Lobe Chat ็š„ๅผ€ๅ‘๏ผŒๅˆ†ไบซๅ’Œ่ฎจ่ฎบๅ…จ็ƒ่Œƒๅ›ดๅ†…็š„ AI ๆถˆๆฏใ€‚

github-actions bot pushed a commit that referenced this pull request Jun 20, 2025
## [Version&nbsp;1.96.0](v1.95.0...v1.96.0)
<sup>Released on **2025-06-20**</sup>

#### โœจ Features

- **misc**: Add v0 (Vercel) provider support.

#### ๐Ÿ› Bug Fixes

- **misc**: Fix inputTemplate behavior.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's improved

* **misc**: Add v0 (Vercel) provider support, closes [#8235](#8235) ([5842a18](5842a18))

#### What's fixed

* **misc**: Fix inputTemplate behavior, closes [#8204](#8204) ([61c2c3c](61c2c3c))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>
@lobehubbot
Copy link
Member

๐ŸŽ‰ This PR is included in version 1.96.0 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€

@hezhijie0327 hezhijie0327 deleted the vercel branch June 20, 2025 22:02
github-actions bot pushed a commit to jaworldwideorg/OneJA-Bot that referenced this pull request Jun 25, 2025
## [Version&nbsp;1.95.0](v1.94.5...v1.95.0)
<sup>Released on **2025-06-25**</sup>

#### โœจ Features

- **misc**: Add Brave & Google PSE & Kagi as build-in Search Provider, add v0 (Vercel) provider support.

#### ๐Ÿ› Bug Fixes

- **misc**: Fix `MiniMax-M1` reasoning tag missing, fix inputTemplate behavior, Google Gemini tools declarations, Remove unsupported parameters of Hunyuan.

#### ๐Ÿ’„ Styles

- **openrouter**: Add stable versions of Gemini 2.5 models.
- **misc**: Add `blockAds` & `stealth` params for Browserless, Optimized Gemini thinkingBudget configuration, update i18n, update i18n.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's improved

* **misc**: Add Brave & Google PSE & Kagi as build-in Search Provider, closes [lobehub#8172](https://github.com/jaworldwideorg/OneJA-Bot/issues/8172) ([16ae521](16ae521))
* **misc**: Add v0 (Vercel) provider support, closes [lobehub#8235](https://github.com/jaworldwideorg/OneJA-Bot/issues/8235) ([5842a18](5842a18))

#### What's fixed

* **misc**: Fix `MiniMax-M1` reasoning tag missing, closes [lobehub#8240](https://github.com/jaworldwideorg/OneJA-Bot/issues/8240) ([ea76c11](ea76c11))
* **misc**: Fix inputTemplate behavior, closes [lobehub#8204](https://github.com/jaworldwideorg/OneJA-Bot/issues/8204) ([61c2c3c](61c2c3c))
* **misc**: Google Gemini tools declarations, closes [lobehub#8256](https://github.com/jaworldwideorg/OneJA-Bot/issues/8256) ([08f5d73](08f5d73))
* **misc**: Remove unsupported parameters of Hunyuan, closes [lobehub#8247](https://github.com/jaworldwideorg/OneJA-Bot/issues/8247) ([826d724](826d724))

#### Styles

* **openrouter**: Add stable versions of Gemini 2.5 models, closes [lobehub#8239](https://github.com/jaworldwideorg/OneJA-Bot/issues/8239) ([d34ecab](d34ecab))
* **misc**: Add `blockAds` & `stealth` params for Browserless, closes [lobehub#8255](https://github.com/jaworldwideorg/OneJA-Bot/issues/8255) ([2ff3efa](2ff3efa))
* **misc**: Optimized Gemini thinkingBudget configuration, closes [lobehub#8224](https://github.com/jaworldwideorg/OneJA-Bot/issues/8224) ([03625e8](03625e8))
* **misc**: Update i18n, closes [lobehub#8253](https://github.com/jaworldwideorg/OneJA-Bot/issues/8253) ([b86dc9b](b86dc9b))
* **misc**: Update i18n, closes [lobehub#8242](https://github.com/jaworldwideorg/OneJA-Bot/issues/8242) ([2d1babc](2d1babc))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>
AirboZH pushed a commit to yuanze-dev/lobe-chat that referenced this pull request Jul 9, 2025
* โœจ feat: add v0 (Vercel) provider support

* โ™ป๏ธ refactor: rebrand to `v0`

* ๐Ÿ”จ chore: update Dockerfile ENV

* ๐Ÿ”จ chore: fix desc

* ๐Ÿ’„ style: support model fetch

* ๐Ÿ’„ style: fix reasoning tag

* ๐Ÿ› fix: fix build error

* ๐Ÿ’„ style: better branding
AirboZH pushed a commit to yuanze-dev/lobe-chat that referenced this pull request Jul 9, 2025
## [Version&nbsp;1.96.0](lobehub/lobe-chat@v1.95.0...v1.96.0)
<sup>Released on **2025-06-20**</sup>

#### โœจ Features

- **misc**: Add v0 (Vercel) provider support.

#### ๐Ÿ› Bug Fixes

- **misc**: Fix inputTemplate behavior.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's improved

* **misc**: Add v0 (Vercel) provider support, closes [lobehub#8235](lobehub#8235) ([5842a18](lobehub@5842a18))

#### What's fixed

* **misc**: Fix inputTemplate behavior, closes [lobehub#8204](lobehub#8204) ([61c2c3c](lobehub@61c2c3c))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
๐ŸŒ  Feature Request New feature or request | ็‰นๆ€งไธŽๅปบ่ฎฎ Model Provider ๆจกๅž‹ๆœๅŠกๅ•† released size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants