mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-10-05 15:50:31 +00:00
Enhancement: AI LLM chunk size and context window config (#12891)
This commit is contained in:
@@ -1187,6 +1187,15 @@ LLM_EMBEDDING_BACKEND = os.getenv(
|
||||
) # "huggingface", "openai-like", or "ollama"
|
||||
LLM_EMBEDDING_MODEL = os.getenv("PAPERLESS_AI_LLM_EMBEDDING_MODEL")
|
||||
LLM_EMBEDDING_ENDPOINT = os.getenv("PAPERLESS_AI_LLM_EMBEDDING_ENDPOINT")
|
||||
LLM_EMBEDDING_CHUNK_SIZE = get_int_from_env(
|
||||
"PAPERLESS_AI_LLM_EMBEDDING_CHUNK_SIZE",
|
||||
1024,
|
||||
)
|
||||
if LLM_EMBEDDING_CHUNK_SIZE < 1:
|
||||
raise ImproperlyConfigured("PAPERLESS_AI_LLM_EMBEDDING_CHUNK_SIZE must be >= 1")
|
||||
LLM_CONTEXT_SIZE = get_int_from_env("PAPERLESS_AI_LLM_CONTEXT_SIZE", 8192)
|
||||
if LLM_CONTEXT_SIZE < 1:
|
||||
raise ImproperlyConfigured("PAPERLESS_AI_LLM_CONTEXT_SIZE must be >= 1")
|
||||
LLM_BACKEND = os.getenv("PAPERLESS_AI_LLM_BACKEND") # "ollama" or "openai-like"
|
||||
LLM_MODEL = os.getenv("PAPERLESS_AI_LLM_MODEL")
|
||||
LLM_API_KEY = os.getenv("PAPERLESS_AI_LLM_API_KEY")
|
||||
|
||||
Reference in New Issue
Block a user