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:
Claude
2026-10-09 10:24:57 +00:00
parent 80cd21f89b
commit cdee85d3f4
51 changed files with 2404 additions and 0 deletions
@@ -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;
}
}