langchain.llms.koboldai.KoboldApiLLM¶
class langchain.llms.koboldai.KoboldApiLLM[source]¶
Bases: LLM
Kobold API language model.
It includes several fields that can be used to control the text generation process.
To use this class, instantiate it with the required parameters and call it with a
prompt to generate text. For example:
kobold = KoboldApiLLM(endpoint=”http://localhost:5000”)
result = kobold(“Write a story about a dragon.”)
This will send a POST request to the Kobold API with the provided prompt and
generate text.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
param cache: Optional[bool] = None¶
param callback_manager: Optional[BaseCallbackManager] = None¶
param callbacks: Callbacks = None¶
param endpoint: str [Required]¶
The API endpoint to use for generating text.
param max_context_length: Optional[int] = 1600¶
Maximum number of tokens to send to the model.
minimum: 1
param max_length: Optional[int] = 80¶
Number of tokens to generate.
maximum: 512
minimum: 1
param metadata: Optional[Dict[str, Any]] = None¶
Metadata to add to the run trace.
param rep_pen: Optional[float] = 1.12¶
Base repetition penalty value.
minimum: 1
param rep_pen_range: Optional[int] = 1024¶
Repetition penalty range.
minimum: 0
param rep_pen_slope: Optional[float] = 0.9¶
Repetition penalty slope.
minimum: 0
param tags: Optional[List[str]] = None¶