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 to customize Embedding model with env #5177

Merged
merged 11 commits into from
Jan 15, 2025

Conversation

cookieY
Copy link
Contributor

@cookieY cookieY commented Dec 25, 2024

💻 变更类型 | Change Type

  • ✨ feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 👷 build
  • ⚡️ perf
  • 📝 docs
  • 🔨 chore

🔀 变更说明 | Description of Change

📝 补充信息 | Additional Information

由于之前代码commit差距过大 重新提交,提交说明参考 #4370

Copy link

vercel bot commented Dec 25, 2024

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

A member of the Team first needs to authorize it.

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. 🌠 Feature Request New feature or request | 特性与建议 labels Dec 25, 2024
@lobehubbot
Copy link
Member

👍 @cookieY

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 Dec 25, 2024

Codecov Report

Attention: Patch coverage is 62.31884% with 78 lines in your changes missing coverage. Please review.

Project coverage is 92.98%. Comparing base (4d1a4cd) to head (972c0db).
Report is 25 commits behind head on main.

Files with missing lines Patch % Lines
src/libs/agent-runtime/bedrock/index.ts 31.25% 44 Missing ⚠️
src/libs/agent-runtime/ollama/index.ts 29.72% 26 Missing ⚠️
src/server/globalConfig/parseFilesConfig.ts 89.47% 6 Missing ⚠️
src/server/globalConfig/index.ts 66.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5177      +/-   ##
==========================================
- Coverage   93.09%   92.98%   -0.12%     
==========================================
  Files         631      634       +3     
  Lines       55424    55642     +218     
  Branches     2696     2904     +208     
==========================================
+ Hits        51596    51736     +140     
- Misses       3828     3906      +78     
Flag Coverage Δ
app 92.98% <62.31%> (-0.12%) ⬇️
server 97.99% <ø> (ø)

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.

@halexan
Copy link

halexan commented Dec 25, 2024

支不支持本地部署的embedding模型?例如 api 地址是 http://127.0.0.1/v1 的类 openai 接口?

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Does it support locally deployed embedding models? For example, the api address is an openai-like interface at http://127.0.0.1/v1?

@cookieY
Copy link
Contributor Author

cookieY commented Dec 25, 2024

支不支持本地部署的embedding模型?例如 api 地址是 http://127.0.0.1/v1 的类 openai 接口?

基于现有的框架设计无法实现这样的自定义需求,本地部署可以使用 ollama

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Does it support locally deployed embedding models? For example, the api address is an openai-like interface at http://127.0.0.1/v1?

Such custom requirements cannot be achieved based on the existing framework design. For local deployment, ollama can be used.

src/config/knowledge.ts Outdated Show resolved Hide resolved
src/const/settings/knowledge.ts Show resolved Hide resolved
src/database/schemas/ragEvals.ts Outdated Show resolved Hide resolved
src/libs/agent-runtime/types/embeddings.ts Outdated Show resolved Hide resolved
src/server/globalConfig/parseSystemAgent.ts Outdated Show resolved Hide resolved
src/server/modules/Files/index.ts Outdated Show resolved Hide resolved
@cookieY
Copy link
Contributor Author

cookieY commented Dec 27, 2024

@arvinxx 已根据建议全部进行修改

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@arvinxx All modifications have been made based on suggestions

@jiongjiongJOJO
Copy link

期待尽快合并!!

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Looking forward to merging soon! !

@huanyingtianhe
Copy link

looking forward to seeing the change soon

@bestZwei
Copy link

bestZwei commented Jan 3, 2025

期待尽快合并!!

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Looking forward to merging soon! !

Copy link
Contributor

@arvinxx arvinxx left a comment

Choose a reason for hiding this comment

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

再改一轮,就差不多了

src/const/settings/knowledge.ts Outdated Show resolved Hide resolved
src/server/routers/async/file.ts Outdated Show resolved Hide resolved
src/server/routers/lambda/chunk.ts Show resolved Hide resolved
src/server/routers/async/file.ts Outdated Show resolved Hide resolved
src/server/routers/async/file.ts Outdated Show resolved Hide resolved
src/server/routers/lambda/chunk.ts Outdated Show resolved Hide resolved
@cookieY
Copy link
Contributor Author

cookieY commented Jan 7, 2025

@arvinxx 已修改完毕

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@arvinxx has been modified

@m0eak
Copy link

m0eak commented Jan 11, 2025

期待尽快合并!!

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Looking forward to merging soon! !

@lwabish
Copy link

lwabish commented Jan 11, 2025

Look forward to this PR to try involving zhipu-ai embedding-3 to my lobechat

@cmx4869
Copy link

cmx4869 commented Jan 13, 2025

love you gugs, hope to use custom embedding model soon!!!

@zc16607
Copy link

zc16607 commented Jan 13, 2025

能同时支持自定义baseurl和嵌入模型名称吗?

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Can both custom baseurl and embedded model names be supported?

@coolangcn
Copy link

期待

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


expectations

Copy link

vercel bot commented Jan 14, 2025

Deployment failed with the following error:

The provided GitHub repository does not contain the requested branch or commit reference. Please ensure the repository is not empty.

Copy link

vercel bot commented Jan 14, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
lobe-chat-database ✅ Ready (Inspect) Visit Preview Jan 14, 2025 4:22pm

@arvinxx arvinxx changed the title ✨ feat: 允许用户自行定义 Embedding 模型 ✨ feat: support to Embedding 模型 Jan 14, 2025
@arvinxx arvinxx changed the title ✨ feat: support to Embedding 模型 ✨ feat: support to customize Embedding model with env Jan 14, 2025
@arvinxx arvinxx merged commit eed9357 into lobehub:main Jan 15, 2025
5 of 7 checks passed
@lobehubbot
Copy link
Member

❤️ Great PR @cookieY ❤️

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 Jan 15, 2025
## [Version&nbsp;1.46.0](v1.45.17...v1.46.0)
<sup>Released on **2025-01-15**</sup>

#### ✨ Features

- **misc**: Add lm studio provider, support to customize Embedding model with env.

<br/>

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

#### What's improved

* **misc**: Add lm studio provider, closes [#4483](#4483) ([0ac5802](0ac5802))
* **misc**: Support to customize Embedding model with env, closes [#5177](#5177) ([eed9357](eed9357))

</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.46.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 Jan 15, 2025
## [Version&nbsp;1.88.0](v1.87.8...v1.88.0)
<sup>Released on **2025-01-15**</sup>

#### ✨ Features

- **misc**: Add lm studio provider, support to customize Embedding model with env.

<br/>

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

#### What's improved

* **misc**: Add lm studio provider, closes [lobehub#4483](https://github.com/bentwnghk/lobe-chat/issues/4483) ([0ac5802](0ac5802))
* **misc**: Support to customize Embedding model with env, closes [lobehub#5177](https://github.com/bentwnghk/lobe-chat/issues/5177) ([eed9357](eed9357))

</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 | 特性与建议 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.

[Request] 自定义嵌入模型 Custom Embedding model