mirror of
https://github.com/zylon-ai/private-gpt.git
synced 2025-12-22 07:40:12 +01: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:
parent
fee9f08ef3
commit
2d27a9f956
4 changed files with 54 additions and 3 deletions
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue