FriendliAI
Info
Wir unterstützen ALLE FriendliAI-Modelle, setzen Sie einfach friendliai/ als Präfix, wenn Sie Vervollständigungsanfragen senden
| Eigenschaft | Details |
|---|---|
| Beschreibung | Die schnellste und effizienteste Inferenz-Engine zum Aufbau produktionsreifer, komplexer KI-Systeme. |
| Provider-Routing in LiteLLM | friendliai/ |
| Provider-Dokumentation | FriendliAI ↗ |
| Unterstützte OpenAI-Endpunkte | /chat/completions, /completions |
API-Schlüssel
# env variable
os.environ['FRIENDLI_TOKEN']
Beispielverwendung
from litellm import completion
import os
os.environ['FRIENDLI_TOKEN'] = ""
response = completion(
model="friendliai/meta-llama-3.1-8b-instruct",
messages=[
{"role": "user", "content": "hello from litellm"}
],
)
print(response)
Beispielverwendung - Streaming
from litellm import completion
import os
os.environ['FRIENDLI_TOKEN'] = ""
response = completion(
model="friendliai/meta-llama-3.1-8b-instruct",
messages=[
{"role": "user", "content": "hello from litellm"}
],
stream=True
)
for chunk in response:
print(chunk)
Unterstützte Modelle
Wir unterstützen ALLE FriendliAI KI-Modelle, setzen Sie einfach friendliai/ als Präfix, wenn Sie Vervollständigungsanfragen senden
| Modellname | Funktionsaufruf |
|---|---|
| meta-llama-3.1-8b-instruct | completion(model="friendliai/meta-llama-3.1-8b-instruct", messages) |
| meta-llama-3.1-70b-instruct | completion(model="friendliai/meta-llama-3.1-70b-instruct", messages) |