LLM preprocessor for openai interface#106
Draft
jcustenborder wants to merge 3 commits intodevnen:mainfrom
Draft
Conversation
Adds optional LLM preprocessing that extracts TTS parameters from
natural language instructions in the input text (e.g., "speak excitedly:
Hello!" extracts exaggeration=1.5).
Changes:
- Add llm_preprocessor.py with TTSParamsExtraction Pydantic model and
preprocess_speech_input() using litellm for unified LLM provider access
- Add llm_preprocessing config section with model, api_base, api_key,
timeout, fallback_on_error, and configurable prompt
- Modify openai_speech_endpoint to delegate to custom_tts_endpoint when
preprocessing is enabled
- Add litellm>=1.0.0 to all requirements files
Supports multiple LLM providers via litellm: OpenAI, Anthropic, Gemini,
Mistral, Groq, Ollama, and litellm proxy configurations.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thanks for creating this project!
In my project I'm using openai compatible apis but I wanted to be able to manipulate more of the settings. I came up with the idea of hitting the prompt with a LLM preprocessor to extract the values. Here are a few examples.
"speak excitedly: Hello world!""say calmly and slowly: Take a breath""whisper this in Spanish: Buenos días""read this enthusiastically with high energy: Welcome everyone!"