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

[Feature]: 请求接入 ollama #1973

Open
youngboyooo opened this issue Sep 20, 2024 · 4 comments
Open

[Feature]: 请求接入 ollama #1973

youngboyooo opened this issue Sep 20, 2024 · 4 comments

Comments

@youngboyooo
Copy link

Class | 类型

None

Feature Request | 功能请求

我重定向了 ollama 的url 还是没办法,求一个接入 ollama 的方法,我试了 config 里的配置还是不行

@hongyi-zhao
Copy link
Collaborator

hongyi-zhao commented Sep 21, 2024

怎么不行?

gpt_academic/config.py

Lines 60 to 62 in 597c320

# 此外,您还可以在接入one-api/vllm/ollama时,
# 使用"one-api-*","vllm-*","ollama-*"前缀直接使用非标准方式接入的模型,例如
# AVAIL_LLM_MODELS = ["one-api-claude-3-sonnet-20240229(max_token=100000)", "ollama-phi3(max_token=4096)"]

# 举例: API_URL_REDIRECT = {"https://api.openai.com/v1/chat/completions": "https://reverse-proxy-url/v1/chat/completions", "http://localhost:11434/api/chat": "在这里填写您ollama的URL"}

@youngboyooo
Copy link
Author

怎么不行?

gpt_academic/config.py

Lines 60 to 62 in 597c320

# 此外,您还可以在接入one-api/vllm/ollama时,
# 使用"one-api-*","vllm-*","ollama-*"前缀直接使用非标准方式接入的模型,例如
# AVAIL_LLM_MODELS = ["one-api-claude-3-sonnet-20240229(max_token=100000)", "ollama-phi3(max_token=4096)"]

# 举例: API_URL_REDIRECT = {"https://api.openai.com/v1/chat/completions": "https://reverse-proxy-url/v1/chat/completions", "http://localhost:11434/api/chat": "在这里填写您ollama的URL"}

我就是按照这个方法接入了,然后一直不生效

@youngboyooo
Copy link
Author

我知道为啥了,我配置 config 那个一直都没效果,然后我试了下 config_private这个文件,就生效了

@hongyi-zhao
Copy link
Collaborator

hongyi-zhao commented Sep 24, 2024

这两个作用相同, 优先级不同。config_private优先级高:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants