Skip to content
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

✨ feat: Support Cloudflare Workers AI #3402

Merged
merged 56 commits into from
Nov 11, 2024
Merged

Conversation

BrandonStudio
Copy link
Contributor

@BrandonStudio BrandonStudio commented Aug 5, 2024

💻 变更类型 | Change Type

  • ✨ feat

🔀 变更说明 | Description of Change

  • Support Cloudflare Workers AI text-generation task via official API.
  • Support streams.
  • Support model manifest fetch.
  • Compatible with Cloudflare AI Gateway.

✖ Does not support function calling for now.

Only stable models (not beta) are enabled by default.

📝 补充信息 | Additional Information

Based on #2966 by @sxjeru.

i18n by @sxjeru and groq/llama-3.1-8b-instant.

@BrandonStudio

This comment was marked as outdated.

@BrandonStudio
Copy link
Contributor Author

OK

@BrandonStudio
Copy link
Contributor Author

BTW, I strongly require a sort of model providers, so that we will meet much less conflicts, see #3411.

@arvinxx
Copy link
Contributor

arvinxx commented Sep 25, 2024

BTW, I strongly require a sort of model providers, so that we will meet much less conflicts

I agree with you. I'm considering a new UI to configuration model providers and sort for them. Maybe will implement it in the next few months

src/config/llm.ts Show resolved Hide resolved
src/config/modelProviders/cloudflare.ts Outdated Show resolved Hide resolved
src/libs/agent-runtime/cloudflare/index.ts Show resolved Hide resolved
Copy link

codecov bot commented Sep 26, 2024

Codecov Report

Attention: Patch coverage is 91.44254% with 35 lines in your changes missing coverage. Please review.

Project coverage is 92.54%. Comparing base (1a8584d) to head (3732d96).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/server/modules/AgentRuntime/index.ts 9.09% 10 Missing ⚠️
src/libs/agent-runtime/cloudflare/index.ts 94.30% 7 Missing ⚠️
src/services/_auth.ts 22.22% 7 Missing ⚠️
src/services/chat.ts 14.28% 6 Missing ⚠️
src/libs/agent-runtime/AgentRuntime.ts 57.14% 3 Missing ⚠️
src/libs/agent-runtime/utils/cloudflareHelpers.ts 98.50% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3402      +/-   ##
==========================================
- Coverage   92.55%   92.54%   -0.02%     
==========================================
  Files         517      520       +3     
  Lines       36844    37252     +408     
  Branches     3442     3511      +69     
==========================================
+ Hits        34100    34473     +373     
- Misses       2744     2779      +35     
Flag Coverage Δ
app 92.54% <91.44%> (-0.02%) ⬇️
server 97.26% <ø> (ø)

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.

@BrandonStudio
Copy link
Contributor Author

@arvinxx Do you know how to fix this?

.next/types/app/api/market/route.ts(2,24): error TS2307: Cannot find module '../../../../../src/app/api/market/route.js' or its corresponding type declarations.

@arvinxx
Copy link
Contributor

arvinxx commented Sep 26, 2024

@arvinxx Do you know how to fix this?

.next/types/app/api/market/route.ts(2,24): error TS2307: Cannot find module '../../../../../src/app/api/market/route.js' or its corresponding type declarations.

remove the .next and then rerun npm run dev

Copy link

vercel bot commented Nov 11, 2024

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 Nov 11, 2024 8:49am

@arvinxx arvinxx merged commit efb7adf into lobehub:main Nov 11, 2024
6 of 8 checks passed
@lobehubbot
Copy link
Member

❤️ Great PR @BrandonStudio ❤️

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 Nov 11, 2024
## [Version&nbsp;1.30.0](v1.29.6...v1.30.0)
<sup>Released on **2024-11-11**</sup>

#### ✨ Features

- **misc**: Support Cloudflare Workers AI.

<br/>

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

#### What's improved

* **misc**: Support Cloudflare Workers AI, closes [#3402](#3402) [/github.com/vercel/next.js/issues/38736#issuecomment-1278917422](https://github.com//github.com/vercel/next.js/issues/38736/issues/issuecomment-1278917422) ([efb7adf](efb7adf))

</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.30.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

github-actions bot pushed a commit to bentwnghk/lobe-chat that referenced this pull request Nov 12, 2024
## [Version&nbsp;1.73.0](v1.72.4...v1.73.0)
<sup>Released on **2024-11-12**</sup>

#### ✨ Features

- **misc**: Add support xAI provider, Support Cloudflare Workers AI.

#### 💄 Styles

- **misc**: Fix Windows always showing scrollbar.

<br/>

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

#### What's improved

* **misc**: Add support xAI provider, closes [lobehub#4627](https://github.com/bentwnghk/lobe-chat/issues/4627) ([49e1e08](49e1e08))
* **misc**: Support Cloudflare Workers AI, closes [lobehub#3402](https://github.com/bentwnghk/lobe-chat/issues/3402) [/github.com/vercel/next.js/issues/38736#issuecomment-1278917422](https://github.com//github.com/vercel/next.js/issues/38736/issues/issuecomment-1278917422) ([efb7adf](efb7adf))

#### Styles

* **misc**: Fix Windows always showing scrollbar, closes [lobehub#4502](https://github.com/bentwnghk/lobe-chat/issues/4502) ([780a2a9](780a2a9))

</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
released size:XXL This PR changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants