mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 11:43:54 +00:00
example mistral sdk
This commit is contained in:
parent
bb6f72b315
commit
68e94f0976
2 changed files with 17 additions and 0 deletions
|
@ -8,6 +8,10 @@ model_list:
|
||||||
litellm_params:
|
litellm_params:
|
||||||
model: fireworks_ai/accounts/fireworks/models/llama-v3-70b-instruct
|
model: fireworks_ai/accounts/fireworks/models/llama-v3-70b-instruct
|
||||||
api_key: "os.environ/FIREWORKS"
|
api_key: "os.environ/FIREWORKS"
|
||||||
|
- model_name: mistral-small-latest
|
||||||
|
litellm_params:
|
||||||
|
model: mistral/mistral-small-latest
|
||||||
|
api_key: "os.environ/MISTRAL_API_KEY"
|
||||||
- model_name: tts
|
- model_name: tts
|
||||||
litellm_params:
|
litellm_params:
|
||||||
model: openai/tts-1
|
model: openai/tts-1
|
||||||
|
|
13
litellm/proxy/tests/test_mistral_sdk.py
Normal file
13
litellm/proxy/tests/test_mistral_sdk.py
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
import os
|
||||||
|
|
||||||
|
from mistralai.client import MistralClient
|
||||||
|
from mistralai.models.chat_completion import ChatMessage
|
||||||
|
|
||||||
|
client = MistralClient(api_key="sk-1234", endpoint="http://0.0.0.0:4000")
|
||||||
|
chat_response = client.chat(
|
||||||
|
model="mistral-small-latest",
|
||||||
|
messages=[
|
||||||
|
{"role": "user", "content": "this is a test request, write a short poem"}
|
||||||
|
],
|
||||||
|
)
|
||||||
|
print(chat_response.choices[0].message.content)
|
Loading…
Add table
Add a link
Reference in a new issue