1
0
mirror of https://github.com/imartinez/privateGPT.git synced 2025-05-07 15:58:05 +00:00

Add timeout parameter for better support of openailike LLM tools on local computer (like LM Studio). ()

feat(llm): Improve settings of the OpenAILike LLM
This commit is contained in:
jcbonnet-fwd 2024-05-10 16:44:08 +02:00 committed by GitHub
parent 966af4771d
commit 45df99feb7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 11 additions and 0 deletions
private_gpt
components/llm
settings
settings-vllm.yaml

View File

@ -123,6 +123,9 @@ class LLMComponent:
max_new_tokens=settings.llm.max_new_tokens,
messages_to_prompt=prompt_style.messages_to_prompt,
completion_to_prompt=prompt_style.completion_to_prompt,
tokenizer=settings.llm.tokenizer,
timeout=openai_settings.request_timeout,
reuse_client=False,
)
case "ollama":
try:

View File

@ -205,6 +205,10 @@ class OpenAISettings(BaseModel):
"gpt-3.5-turbo",
description="OpenAI Model to use. Example: 'gpt-4'.",
)
request_timeout: float = Field(
120.0,
description="Time elapsed until openailike server times out the request. Default is 120s. Format is float. ",
)
class OllamaSettings(BaseModel):

View File

@ -3,6 +3,9 @@ server:
llm:
mode: openailike
max_new_tokens: 512
tokenizer: mistralai/Mistral-7B-Instruct-v0.2
temperature: 0.1
embedding:
mode: huggingface
@ -15,3 +18,4 @@ openai:
api_base: http://localhost:8000/v1
api_key: EMPTY
model: facebook/opt-125m
request_timeout: 600.0