Skip to main content

KoboldAI API

KoboldAI is a "a browser-based front-end for AI-assisted writing with multiple local & remote AI models...". It has a public and local API that is able to be used in langchain.

This example goes over how to use LangChain with that API.

Documentation can be found in the browser adding /api to the end of your endpoint (i.e

from langchain_community.llms import KoboldApiLLM
API Reference:KoboldApiLLM

Replace the endpoint seen below with the one shown in the output after starting the webui with --api or --public-api

Optionally, you can pass in parameters like temperature or max_length

llm = KoboldApiLLM(endpoint="", max_length=80)
response = llm.invoke(
"### Instruction:\nWhat is the first book of the bible?\n### Response:"

Was this page helpful?

You can also leave detailed feedback on GitHub.