You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"content": "this is a test request, write a short poem"
100
+
}
101
+
])
102
+
103
+
print(response)
104
+
105
+
```
106
+
</TabItem>
107
+
<TabItemvalue="langchain"label="Langchain">
108
+
109
+
```python
110
+
from langchain.chat_models import ChatOpenAI
111
+
from langchain.prompts.chat import (
112
+
ChatPromptTemplate,
113
+
HumanMessagePromptTemplate,
114
+
SystemMessagePromptTemplate,
115
+
)
116
+
from langchain.schema import HumanMessage, SystemMessage
117
+
118
+
chat = ChatOpenAI(
119
+
openai_api_base="http://0.0.0.0:4000", # set openai_api_base to the LiteLLM Proxy
120
+
model="mistral-small-latest",
121
+
temperature=0.1
122
+
)
123
+
124
+
messages = [
125
+
SystemMessage(
126
+
content="You are a helpful assistant that im using to make a test request to."
127
+
),
128
+
HumanMessage(
129
+
content="test from litellm. tell me why it's amazing in 1 sentence"
130
+
),
131
+
]
132
+
response = chat(messages)
133
+
134
+
print(response)
135
+
```
136
+
</TabItem>
137
+
</Tabs>
138
+
44
139
## Supported Models
140
+
141
+
:::info
45
142
All models listed here https://docs.mistral.ai/platform/endpoints are supported. We actively maintain the list of models, pricing, token window, etc. [here](https://github.com/BerriAI/litellm/blob/main/model_prices_and_context_window.json).
0 commit comments