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
I just saw Librechat support Claude 3.7 with thinking(#6008), and that is awesome!
since we are using Litellm as AI gateway configured with VertexAI claude 3.7, we are curious if we could use it with thinking mode enabled as well, thank you
This is a working example of using OpenAI SDK with Litellm vertexai claude 3.7 configured
from openai import OpenAI
client = OpenAI(
base_url="https://litellm.abc.com",
api_key="sk-xxxx"
)
response = client.chat.completions.create(
model="vertex_ai/claude-3-7-sonnet@20250219",
stream=True,
messages=[
{"role": "system", "content": "You are a helpful assistant designed to output JSON."},
{"role": "user", "content": "Melbourne best coffee shop"}
],
extra_body={
"thinking": {
"type": "enabled",
"budget_tokens": 1024
}
}
)
print(f"response: {response}")
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I just saw Librechat support Claude 3.7 with thinking(#6008), and that is awesome!
since we are using Litellm as AI gateway configured with VertexAI claude 3.7, we are curious if we could use it with thinking mode enabled as well, thank you
This is a working example of using OpenAI SDK with Litellm vertexai claude 3.7 configured
Let me know if you need more info, thanks.
Beta Was this translation helpful? Give feedback.
All reactions