mirror of
https://github.com/AJaySi/ALwrity.git
synced 2026-04-26 01:15:52 +03:00
[PR #417] [MERGED] Centralize text routing policy; set premium HF default to openai/gpt-oss-120b:groq #726
Labels
No labels
AI Content Agents
AI Content Strategy
AI Content planning
AI Marketing Tools
AI SEO
AI personalization
AI writer
ALwrity Copi-lot
Alwrity web search
Anthropic
DeepSeek
Gemini AI
Integration
LLM
OnBoarding
OnBoarding
RAG knowledgebase Memory
bug
documentation
enhancement
good first issue
help wanted
invalid
openai
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ALwrity#726
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/AJaySi/ALwrity/pull/417
Author: @AJaySi
Created: 3/12/2026
Status: ✅ Merged
Merged: 3/12/2026
Merged by: @AJaySi
Base:
main← Head:codex/create-policy-module-for-model-routing📝 Commits (1)
d4528fbAdd centralized text routing policy and premium HF defaults📊 Changes
3 files changed (+62 additions, -21 deletions)
View changed files
📝
backend/services/llm_providers/huggingface_provider.py(+8 -7)📝
backend/services/llm_providers/main_text_generation.py(+24 -14)➕
backend/services/llm_providers/routing_policy.py(+30 -0)📄 Description
Motivation
openai/gpt-oss-120b:groqand support a low-cost SIF default model for the SIF flow.GPT_PROVIDER=wavespeedto route to the premium Hugging Face text path only, without changing existing WaveSpeed image/video behavior.Description
backend/services/llm_providers/routing_policy.pywhich definesPREMIUM_DEFAULT_PROVIDER,PREMIUM_DEFAULT_MODEL(openai/gpt-oss-120b:groq),SIF_LOW_COST_MODEL_DEFAULTS, provider alias mapping (including"wavespeed": "huggingface"for text), andresolve_text_provider_alias().backend/services/llm_providers/main_text_generation.pyto useresolve_text_provider_alias()and the routing constants instead of hardcoded HF model strings, to prefer the SIF low-cost model whenpreferred_hf_modelsflow is used, and to use policy-aware fallback selection.backend/services/llm_providers/huggingface_provider.pyto consume the centralized constants for defaultmodelargs, fallback model sequence (HF_FALLBACK_MODELS), andget_available_models().wavespeed), while leaving WaveSpeed image/video modules unchanged.Testing
python -m py_compile backend/services/llm_providers/routing_policy.py backend/services/llm_providers/main_text_generation.py backend/services/llm_providers/huggingface_provider.pysucceeded.PYTHONPATH=backend python - <<'PY' ...validated alias resolution and constants and confirmedresolve_text_provider_alias('wavespeed')=>huggingfaceand the configured premium/low-cost model values (succeeded underPYTHONPATH=backend).PYTHONPATHfailed due to module path context (expected in a local dev environment) and did not block the changes.Codex Task
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.