Skip to content

Commit 7ced57d

Browse files
committed
Release 0.7.9
1 parent f270d47 commit 7ced57d

9 files changed

Lines changed: 77 additions & 7 deletions

File tree

openclaw-plugin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@anjieyang/uncommon-route",
3-
"version": "0.7.8",
3+
"version": "0.7.9",
44
"description": "OpenClaw plugin for UncommonRoute, the local LLM router that cuts premium-model spend",
55
"type": "module",
66
"main": "src/index.js",

openclaw-plugin/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import { spawn, execSync } from "node:child_process";
1717
import { setTimeout as sleep } from "node:timers/promises";
1818

19-
const VERSION = "0.7.8";
19+
const VERSION = "0.7.9";
2020
const DEFAULT_PORT = 8403;
2121
const DEFAULT_UPSTREAM = "";
2222
const HEALTH_TIMEOUT_MS = 15_000;

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "uncommon-route"
3-
version = "0.7.8"
3+
version = "0.7.9"
44
description = "Local LLM router that cuts premium-model spend with adaptive 3-tier routing, OpenAI + Anthropic compatible"
55
requires-python = ">=3.11"
66
license = "MIT"

tests/test_model_experience.py

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,75 @@ def test_route_adapts_to_model_experience() -> None:
226226
selector._rng.setstate(rng_state)
227227

228228

229+
def test_select_from_pool_uses_local_feedback_prior_strength(monkeypatch) -> None:
230+
import uncommon_route.benchmark as benchmark
231+
232+
class DummyBenchmarkCache:
233+
def get_all_qualities(self, models):
234+
return {
235+
"alpha/model": 0.90,
236+
"beta/model": 0.70,
237+
}
238+
239+
monkeypatch.setattr(benchmark, "get_benchmark_cache", lambda: DummyBenchmarkCache())
240+
241+
store = ModelExperienceStore(storage=InMemoryModelExperienceStorage(), alpha=0.25)
242+
for _ in range(5):
243+
store.record_feedback("alpha/model", RoutingMode.AUTO, Tier.SIMPLE, "weak")
244+
245+
common_kwargs = dict(
246+
complexity=0.15,
247+
mode=RoutingMode.AUTO,
248+
confidence=0.8,
249+
reasoning_text="test",
250+
available_models=["alpha/model", "beta/model"],
251+
estimated_input_tokens=100,
252+
max_output_tokens=100,
253+
prompt="hello",
254+
pricing={
255+
"alpha/model": ModelPricing(1.0, 1.0),
256+
"beta/model": ModelPricing(1.0, 1.0),
257+
},
258+
capabilities={
259+
"alpha/model": infer_capabilities("alpha/model", ModelPricing(1.0, 1.0), has_explicit_pricing=True),
260+
"beta/model": infer_capabilities("beta/model", ModelPricing(1.0, 1.0), has_explicit_pricing=True),
261+
},
262+
requirements=RequestRequirements(),
263+
selection_weights=SelectionWeights(
264+
editorial=0.0,
265+
cost=0.0,
266+
latency=0.0,
267+
reliability=0.0,
268+
feedback=0.0,
269+
cache_affinity=0.0,
270+
byok=0.0,
271+
free_bias=0.0,
272+
local_bias=0.0,
273+
reasoning_bias=0.0,
274+
quality_alignment=0.0,
275+
continuity=0.0,
276+
),
277+
model_experience=store,
278+
)
279+
280+
high_prior = select_from_pool(
281+
**common_kwargs,
282+
bandit_config=BanditConfig(enabled=False, prior_n=20.0),
283+
)
284+
low_prior = select_from_pool(
285+
**common_kwargs,
286+
bandit_config=BanditConfig(enabled=False, prior_n=5.0),
287+
)
288+
289+
assert high_prior.model == "alpha/model"
290+
assert low_prior.model == "beta/model"
291+
292+
high_alpha = next(score for score in high_prior.candidate_scores if score.model == "alpha/model")
293+
low_alpha = next(score for score in low_prior.candidate_scores if score.model == "alpha/model")
294+
assert high_alpha.predicted_quality > 0.70
295+
assert low_alpha.predicted_quality < 0.70
296+
297+
229298
def test_best_mode_uses_higher_quality_threshold() -> None:
230299
"""BEST mode's higher threshold excludes lower-quality models."""
231300
pricing = {

uncommon_route/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
from uncommon_route.router.classifier import classify
3939
from uncommon_route.router.structural import extract_structural_features, extract_unicode_block_features
4040

41-
VERSION = "0.7.8"
41+
VERSION = "0.7.9"
4242
_DATA_DIR = data_dir()
4343
_PID_FILE = _DATA_DIR / "serve.pid"
4444
_LOG_FILE = _DATA_DIR / "serve.log"

uncommon_route/proxy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
logger = logging.getLogger("uncommon-route")
120120
_debug_log = logging.getLogger("uncommon_route.debug_routing")
121121

122-
VERSION = "0.7.8"
122+
VERSION = "0.7.9"
123123
DEFAULT_UPSTREAM = ""
124124
DEFAULT_PORT = int(os.environ.get("UNCOMMON_ROUTE_PORT", "8403"))
125125

uncommon_route/router/selector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,7 @@ def select_from_pool(
833833

834834
mu = complexity
835835
bandit_active = bc.enabled
836-
prior_n = 20.0
836+
prior_n = max(0.0, float(bc.prior_n))
837837

838838
# Mode controls quality-vs-cost preference:
839839
# FAST → strongly prefer cheap (low cost_sensitivity = quality matters less)

uncommon_route/router/types.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ class BanditConfig:
321321
enabled: bool = True
322322
reward_weight: float = 0.12
323323
exploration_weight: float = 0.18
324+
prior_n: float = 5.0
324325
warmup_pulls: int = 2
325326
min_samples_for_guardrail: int = 3
326327
min_reliability: float = 0.25

uncommon_route/support.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def _package_version() -> str:
4646

4747
return version("uncommon-route")
4848
except Exception:
49-
return "0.7.8"
49+
return "0.7.9"
5050

5151

5252
def _feedback_buffer_summary(root: Path) -> dict[str, Any]:

0 commit comments

Comments
 (0)