Add llm-gateway module: routing, failover below the tool-calling advisor, per-provider circuit breakers, dollar caps and token limits, tenant-keyed cache; real OpenAI and Anthropic models against a local fake
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JXVi2GMQ7bR5EmbUFdDj7N
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package com.ankurm.gateway;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/** Maps a model hint to an ordered list of targets. An unknown hint is an error, not a default. */
|
||||
public final class Routes {
|
||||
|
||||
private final Map<String, List<Target>> table;
|
||||
|
||||
public Routes(Map<String, List<Target>> table) {
|
||||
this.table = Map.copyOf(table);
|
||||
}
|
||||
|
||||
public List<Target> get(String hint) {
|
||||
List<Target> t = table.get(hint);
|
||||
if (t == null) {
|
||||
throw new UnknownHintException(hint, table.keySet());
|
||||
}
|
||||
return t;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user