Implement LLM client and normalization settings

- Added LLMClient class for handling requests to LLM API, including methods for listing models and generating completions.
- Introduced LLMConfiguration dataclass for managing LLM configuration settings.
- Created normalization_settings module to manage normalization configurations and environment variable overrides.
- Developed JavaScript functionality for the settings interface, including model fetching and preview generation for LLM and normalization.
- Enhanced user experience with status messages and error handling in the settings UI.
This commit is contained in:
JB
2025-10-26 07:42:12 -07:00
parent 0a6d09445d
commit 6b5255a80d
11 changed files with 1848 additions and 176 deletions
+11
View File
@@ -25,3 +25,14 @@ ABOGEN_TEMP_DIR=./storage/tmp
# id -g # GID
ABOGEN_UID=1000
ABOGEN_GID=1000
# Optional: Seed the web UI with working defaults for the LLM-powered
# text normalization features. Leave these blank to configure everything
# from the Settings page.
ABOGEN_LLM_BASE_URL=https://localhost:11434/v1
ABOGEN_LLM_API_KEY=ollama
ABOGEN_LLM_MODEL=llama3.1:8b
ABOGEN_LLM_TIMEOUT=45
ABOGEN_LLM_CONTEXT_MODE=paragraph
# For custom prompts, keep the text on a single line or escape newlines.
#ABOGEN_LLM_PROMPT=You are assisting with audiobook preparation. Rewrite {{sentence}} for narration.