MCPcopy Create free account
hub / github.com/Not-Diamond/RoRF / __init__

Method __init__

rorf/controller.py:24–40  ·  view source on GitHub ↗

Initialize the RoRF controller with the specified router, model A, model B, and threshold. Threshold determines the percentage of calls made to model A by the router.

(
        self,
        router: str,
        model_a: str,
        model_b: str,
        threshold: float,
    )

Source from the content-addressed store, hash-verified

22
23class Controller:
24 def __init__(
25 self,
26 router: str,
27 model_a: str,
28 model_b: str,
29 threshold: float,
30 ):
31 """
32 Initialize the RoRF controller with the specified router, model A, model B, and threshold.
33 Threshold determines the percentage of calls made to model A by the router.
34 """
35 self._validate_router_threshold(router, threshold)
36 self.embedding_provider = self._parse_model_name(router)
37 logger.info(f"Initializing RoRF controller for {router} with {self.embedding_provider} embeddings...")
38 self.router_model, self.embedding_model = self.load(router, self.embedding_provider)
39 self.model_a, self.model_b = model_a, model_b
40 self.threshold = threshold
41
42 def _validate_router_threshold(
43 self, router: Optional[str], threshold: Optional[float]

Callers

nothing calls this directly

Calls 3

_parse_model_nameMethod · 0.95
loadMethod · 0.95

Tested by

no test coverage detected