Expand description
§The SimiFlow Routing Pipeline
Developers should not have to manually write fallback logic. The pipeline allows defining thresholds to avoid expensive API calls.
§Execution Flow
- Tier 1 (Fast Pass): Run a fast algorithm like Levenshtein. If it is an obvious match (> 0.95) or mismatch (< 0.10), return immediately for zero cost.
- Tier 2 (Heavy Local Pass): If it falls in the ambiguous middle, fallback to a heavier algorithm like BM25.
- Tier 3 (API Hook): Provide an optional callback where the user can trigger their expensive LLM API only if Tiers 1 and 2 fail.
Structs§
- Comparison
Result - The result of comparing two strings through the pipeline.
- Simi
Flow - The SimiFlow: a declarative pipeline builder for similarity checks.
Enums§
- Algo
- Algorithm selector for a tier.
- Intent
- User intent: declares what kind of comparison is being performed.
- Strategy
- The comparison strategy for the router.
- Threshold
- Threshold configuration for a tier.
Functions§
- resolve_
intent - Map an intent to an algorithm.
Type Aliases§
- Fallback
Fn - Callback type for the Tier 3 (LLM/API) fallback.
- Score
- A normalized similarity score from
[0.0, 1.0].