-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs[minor]: Add example using LiteLLM Proxy server #6197
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@jacoblee93 do you know how I can get this to appear on the sidebar - I can't find any examples on how to do so |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good, just some nits & move code examples to code blocks. I'm converting this back to a draft, please mark as ready for review & re-request my review once implemented! Thanks
```js | ||
import { ChatOpenAI } from "@langchain/openai"; | ||
|
||
const model = new ChatOpenAI({ | ||
modelName: "claude-3-5-sonnet-20240620", // swap this for "gpt-4o-mini", "gemini-1.5-pro", "claude-3-5-sonnet-20240620" | ||
openAIApiKey: "sk-1234", | ||
}, { | ||
basePath: "http://0.0.0.0:4000", // set basePath to LiteLLM Proxy server | ||
}); | ||
|
||
const message = await model.invoke("Hi there!"); | ||
|
||
console.log(message); | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should either be an imported codeblock from the examples directory, or convert this to a notebook (use tslab to run typescript in notebooks) and have the code in cells. This way we can verify the code can be executed & run a linter/formatter across it.
Same for the rest of the typescript code blocks below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Co-authored-by: Brace Sproul <[email protected]>
Co-authored-by: Brace Sproul <[email protected]>
Co-authored-by: Brace Sproul <[email protected]>
Co-authored-by: Brace Sproul <[email protected]>
Co-authored-by: Brace Sproul <[email protected]>
@bracesproul do you know how I can get this to appear on the sidebar - I can't find any examples on how to do so |
Looks like the vercel deployment is failing. Could you push up a fix? Thanks
|
Hi i'm the LiteLLM (https://github.com/BerriAI/litellm) maintainer - making this PR to add a doc on how to use LiteLLM Proxy server with Langchain JS. Please let me know if you have any suggestions / feedback
Fixes # (issue)