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(model): Support yi proxy LLM #1303

Merged
merged 2 commits into from
Mar 15, 2024

Conversation

fangyinc
Copy link
Collaborator

Description

  • Support yi proxy LLM

How Has This Been Tested?

  1. Using yi proxyllm in DB-GPT webserver
# .env
LLM_MODEL=yi_proxyllm
YI_MODEL_VERSION=yi-34b-chat-0205
YI_API_BASE=https://api.lingyiwanwu.com/v1
YI_API_KEY={your-yi-api-key}
  1. Using YiLLMClient
    Create python file test_yi_proxyllm.py
import asyncio

from dbgpt.core import ModelRequest
from dbgpt.model.proxy import YiLLMClient

client = YiLLMClient()
print(asyncio.run(client.generate(ModelRequest._build("yi-34b-chat-0205", "你是谁?"))))

Run test_yi_proxyllm.py

YI_API_KEY={your-yi-api-key} python test_yi_proxyllm.py

The output like this:

ModelOutput(text='我是一个人工智能助手,由零一万物公司开发。我是由工程师们编写代码,并通过算法提供各种信息和帮助的。我可以回答问题、编写文本以及提供各种帮助。我是通过学习大量的文本数据来sage={'completion_tokens': 60, 'prompt_tokens': 12, 'total_tokens': 72}, metrics=None)

Snapshots:

Include snapshots for easier review.

Checklist:

  • My code follows the style guidelines of this project
  • I have already rebased the commits and make the commit message conform to the project standard.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • Any dependent changes have been merged and published in downstream modules

@github-actions github-actions bot added enhancement New feature or request model Module: model labels Mar 15, 2024
@csunny
Copy link
Collaborator

csunny commented Mar 15, 2024

Cool~

image

Copy link
Collaborator

@csunny csunny left a comment

Choose a reason for hiding this comment

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

r+

Copy link
Contributor

@yihong0618 yihong0618 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@Aries-ckt Aries-ckt left a comment

Choose a reason for hiding this comment

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

r+

@Aries-ckt Aries-ckt merged commit 130ffb0 into eosphoros-ai:main Mar 15, 2024
5 checks passed
Hopshine pushed a commit to Hopshine/DB-GPT that referenced this pull request Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request model Module: model
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants