Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save WhiteyDude/a0bb315fef6c9fa76268fe41ee634b1b to your computer and use it in GitHub Desktop.
Save WhiteyDude/a0bb315fef6c9fa76268fe41ee634b1b to your computer and use it in GitHub Desktop.
Langchain example for oobabooga API
process.env.OPENAI_API_BASE = 'http://127.0.0.1:5001/v1';
const { OpenAI } = require("langchain/llms/openai");
const model = new OpenAI(
{
openAIApiKey: 'sk-dummy',
temperature: 0.9,
},
{
basePath: process.env.OPENAI_API_BASE
});
model.call("What are the names of the planeteers from the TV show Captain Planet?")
.then( (res) => {
console.log(res);
})
@WhiteyDude
Copy link
Author

Note you need to load a model first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment