Spaces:
Running
Running
Sync from GitHub (tests passed)
Browse files- app/settings.py +20 -14
- scripts/probe_openrouter_contracts.py +3 -3
app/settings.py
CHANGED
|
@@ -89,16 +89,21 @@ class Settings(BaseSettings):
|
|
| 89 |
|
| 90 |
# OpenRouter AI Commentary
|
| 91 |
openrouter_api_key: Optional[str] = None
|
| 92 |
-
# Deprecated - kept for backward compatibility
|
| 93 |
-
|
|
|
|
|
|
|
| 94 |
# Keep fast and reliable roles independent so one provider/model removal
|
| 95 |
-
# cannot collapse the entire LLM path.
|
| 96 |
-
#
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
|
|
|
|
|
|
|
|
|
| 102 |
openrouter_max_retries: int = 1
|
| 103 |
openrouter_timeout_seconds: float = 45.0
|
| 104 |
openrouter_chain_deadline_seconds: float = 120.0
|
|
@@ -110,7 +115,8 @@ class Settings(BaseSettings):
|
|
| 110 |
# client as transport-level fallbacks when the primary model 429s/5xx's.
|
| 111 |
# Example: "google/gemini-flash-1.5:free,meta-llama/llama-3.1-8b-instruct:free"
|
| 112 |
openrouter_fallback_models: Optional[str] = (
|
| 113 |
-
"google/gemma-4-
|
|
|
|
| 114 |
)
|
| 115 |
tokenizers_parallelism: str = "false"
|
| 116 |
|
|
@@ -128,7 +134,7 @@ class Settings(BaseSettings):
|
|
| 128 |
|
| 129 |
# LLM Sentiment Analysis
|
| 130 |
# Deprecated - kept for backward compatibility
|
| 131 |
-
llm_sentiment_model: str = "
|
| 132 |
|
| 133 |
# Pipeline trigger authentication
|
| 134 |
pipeline_trigger_secret: Optional[str] = None
|
|
@@ -249,7 +255,7 @@ class Settings(BaseSettings):
|
|
| 249 |
self.llm_sentiment_model,
|
| 250 |
self.openrouter_model,
|
| 251 |
)
|
| 252 |
-
or "
|
| 253 |
)
|
| 254 |
|
| 255 |
@property
|
|
@@ -267,7 +273,7 @@ class Settings(BaseSettings):
|
|
| 267 |
self.llm_sentiment_model,
|
| 268 |
self.openrouter_model_scoring,
|
| 269 |
)
|
| 270 |
-
or "
|
| 271 |
)
|
| 272 |
|
| 273 |
@property
|
|
@@ -279,7 +285,7 @@ class Settings(BaseSettings):
|
|
| 279 |
self.openrouter_model,
|
| 280 |
self.llm_sentiment_model,
|
| 281 |
)
|
| 282 |
-
or "
|
| 283 |
)
|
| 284 |
|
| 285 |
@property
|
|
|
|
| 89 |
|
| 90 |
# OpenRouter AI Commentary
|
| 91 |
openrouter_api_key: Optional[str] = None
|
| 92 |
+
# Deprecated - kept for backward compatibility. Keep this on a currently
|
| 93 |
+
# listed free model so installations without an explicit env override do
|
| 94 |
+
# not silently start with a retired OpenRouter slug.
|
| 95 |
+
openrouter_model: str = "nex-agi/nex-n2.5-mini:free"
|
| 96 |
# Keep fast and reliable roles independent so one provider/model removal
|
| 97 |
+
# cannot collapse the entire LLM path. Nex-N2.5-Mini passed the exact V2
|
| 98 |
+
# scoring contract probe on 2026-09-12; Gemma 4 31B is the independent
|
| 99 |
+
# structured-output repair/commentary fallback.
|
| 100 |
+
openrouter_model_scoring: str = "nex-agi/nex-n2.5-mini:free"
|
| 101 |
+
openrouter_model_scoring_fast: Optional[str] = "nex-agi/nex-n2.5-mini:free"
|
| 102 |
+
openrouter_model_scoring_reliable: Optional[str] = "google/gemma-4-31b-it:free"
|
| 103 |
+
openrouter_model_commentary: str = "nex-agi/nex-n2.5-mini:free"
|
| 104 |
+
# Stay below the shared free-provider request ceiling. The worker still
|
| 105 |
+
# uses bounded retries and a per-chain deadline for transient 429s.
|
| 106 |
+
openrouter_rpm: int = 12
|
| 107 |
openrouter_max_retries: int = 1
|
| 108 |
openrouter_timeout_seconds: float = 45.0
|
| 109 |
openrouter_chain_deadline_seconds: float = 120.0
|
|
|
|
| 115 |
# client as transport-level fallbacks when the primary model 429s/5xx's.
|
| 116 |
# Example: "google/gemini-flash-1.5:free,meta-llama/llama-3.1-8b-instruct:free"
|
| 117 |
openrouter_fallback_models: Optional[str] = (
|
| 118 |
+
"nex-agi/nex-n2.5-mini:free,google/gemma-4-31b-it:free,"
|
| 119 |
+
"google/gemma-4-26b-a4b-it:free,liquid/lfm-2.5-2.6b:free"
|
| 120 |
)
|
| 121 |
tokenizers_parallelism: str = "false"
|
| 122 |
|
|
|
|
| 134 |
|
| 135 |
# LLM Sentiment Analysis
|
| 136 |
# Deprecated - kept for backward compatibility
|
| 137 |
+
llm_sentiment_model: str = "nex-agi/nex-n2.5-mini:free"
|
| 138 |
|
| 139 |
# Pipeline trigger authentication
|
| 140 |
pipeline_trigger_secret: Optional[str] = None
|
|
|
|
| 255 |
self.llm_sentiment_model,
|
| 256 |
self.openrouter_model,
|
| 257 |
)
|
| 258 |
+
or "nex-agi/nex-n2.5-mini:free"
|
| 259 |
)
|
| 260 |
|
| 261 |
@property
|
|
|
|
| 273 |
self.llm_sentiment_model,
|
| 274 |
self.openrouter_model_scoring,
|
| 275 |
)
|
| 276 |
+
or "google/gemma-4-31b-it:free"
|
| 277 |
)
|
| 278 |
|
| 279 |
@property
|
|
|
|
| 285 |
self.openrouter_model,
|
| 286 |
self.llm_sentiment_model,
|
| 287 |
)
|
| 288 |
+
or "nex-agi/nex-n2.5-mini:free"
|
| 289 |
)
|
| 290 |
|
| 291 |
@property
|
scripts/probe_openrouter_contracts.py
CHANGED
|
@@ -89,9 +89,9 @@ async def run_probe(*, fast: str, reliable: str, commentary_model: str) -> dict:
|
|
| 89 |
|
| 90 |
def main() -> int:
|
| 91 |
parser = argparse.ArgumentParser(description="Probe exact OpenRouter production contracts")
|
| 92 |
-
parser.add_argument("--fast", default="
|
| 93 |
-
parser.add_argument("--reliable", default="
|
| 94 |
-
parser.add_argument("--commentary", default="
|
| 95 |
args = parser.parse_args()
|
| 96 |
result = asyncio.run(run_probe(fast=args.fast, reliable=args.reliable, commentary_model=args.commentary))
|
| 97 |
print(json.dumps(result, indent=2))
|
|
|
|
| 89 |
|
| 90 |
def main() -> int:
|
| 91 |
parser = argparse.ArgumentParser(description="Probe exact OpenRouter production contracts")
|
| 92 |
+
parser.add_argument("--fast", default="nex-agi/nex-n2.5-mini:free")
|
| 93 |
+
parser.add_argument("--reliable", default="google/gemma-4-31b-it:free")
|
| 94 |
+
parser.add_argument("--commentary", default="nex-agi/nex-n2.5-mini:free")
|
| 95 |
args = parser.parse_args()
|
| 96 |
result = asyncio.run(run_probe(fast=args.fast, reliable=args.reliable, commentary_model=args.commentary))
|
| 97 |
print(json.dumps(result, indent=2))
|