Packages
agentsea_gateway
0.1.0
AgentSea gateway: strategy-based routing, circuit breaking, and failover across LLM providers.
Current section
Files
Jump to
Current section
Files
lib/agent_sea/gateway/router/cost_optimized.ex
defmodule AgentSea.Gateway.Router.CostOptimized do
@moduledoc "Orders candidates cheapest-model-first using `AgentSea.ModelPricing`."
@behaviour AgentSea.Gateway.Router
@impl true
def order(candidates, _ctx) do
Enum.sort_by(candidates, &AgentSea.ModelPricing.weight(&1.model))
end
end