mirror of
https://github.com/imartinez/privateGPT.git
synced 2025-09-13 13:50:49 +00:00
feat(llm): Add openailike llm mode (#1447)
This mode behaves the same as the openai mode, except that it allows setting custom models not supported by OpenAI. It can be used with any tool that serves models from an OpenAI compatible API. Implements #1424
This commit is contained in:
@@ -81,7 +81,7 @@ class DataSettings(BaseModel):
|
||||
|
||||
|
||||
class LLMSettings(BaseModel):
|
||||
mode: Literal["local", "openai", "sagemaker", "mock"]
|
||||
mode: Literal["local", "openai", "openailike", "sagemaker", "mock"]
|
||||
max_new_tokens: int = Field(
|
||||
256,
|
||||
description="The maximum number of token that the LLM is authorized to generate in one completion.",
|
||||
@@ -156,6 +156,10 @@ class SagemakerSettings(BaseModel):
|
||||
|
||||
|
||||
class OpenAISettings(BaseModel):
|
||||
api_base: str = Field(
|
||||
None,
|
||||
description="Base URL of OpenAI API. Example: 'https://api.openai.com/v1'.",
|
||||
)
|
||||
api_key: str
|
||||
model: str = Field(
|
||||
"gpt-3.5-turbo",
|
||||
|
Reference in New Issue
Block a user