Zum Hauptinhalt springen

Anyscale

https://app.endpoints.anyscale.com/

API-Schlüssel

# env variable
os.environ['ANYSCALE_API_KEY']

Beispielverwendung

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)

Beispielverwendung - Streaming

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)

Unterstützte Modelle

Alle hier aufgelisteten Modelle unter https://app.endpoints.anyscale.com/ werden unterstützt. Wir pflegen aktiv die Liste der Modelle, Preise, Token-Fenster usw. hier.

ModellnameFunktionsaufruf
llama2-7b-chatcompletion(model="anyscale/meta-llama/Llama-2-7b-chat-hf", messages)
llama-2-13b-chatcompletion(model="anyscale/meta-llama/Llama-2-13b-chat-hf", messages)
llama-2-70b-chatcompletion(model="anyscale/meta-llama/Llama-2-70b-chat-hf", messages)
mistral-7b-instructcompletion(model="anyscale/mistralai/Mistral-7B-Instruct-v0.1", messages)
CodeLlama-34b-Instructcompletion(model="anyscale/codellama/CodeLlama-34b-Instruct-hf", messages)