Anyscale
https://app.endpoints.anyscale.com/
API 密钥
# env variable
os.environ['ANYSCALE_API_KEY']
示例用法
from litellm import completion
import os
os.environ['ANYSCALE_API_KEY'] = ""
response = completion(
model="anyscale/mistralai/Mistral-7B-Instruct-v0.1",
messages=messages
)
print(response)
示例用法 - 流式传输
from litellm import completion
import os
os.environ['ANYSCALE_API_KEY'] = ""
response = completion(
model="anyscale/mistralai/Mistral-7B-Instruct-v0.1",
messages=messages,
stream=True
)
for chunk in response:
print(chunk)
支持的模型
此处列出的所有模型 https://app.endpoints.anyscale.com/ 均受支持。我们积极维护此处 here 列出的模型列表、定价、上下文窗口等信息。
模型名称 | 函数调用 |
---|---|
llama2-7b-chat | completion(model="anyscale/meta-llama/Llama-2-7b-chat-hf", messages) |
llama-2-13b-chat | completion(model="anyscale/meta-llama/Llama-2-13b-chat-hf", messages) |
llama-2-70b-chat | completion(model="anyscale/meta-llama/Llama-2-70b-chat-hf", messages) |
mistral-7b-instruct | completion(model="anyscale/mistralai/Mistral-7B-Instruct-v0.1", messages) |
CodeLlama-34b-Instruct | completion(model="anyscale/codellama/CodeLlama-34b-Instruct-hf", messages) |