AISBFAI Service Broker Framework — AI Should Be Free
Copyable routing patterns for cost tiers, privacy-first workloads, burst GPU routing, model-family separation, and graceful provider degradation.
AISBF routing is easier to reason about when each layer has one job.
A concrete backend: OpenAI-compatible API, local Ollama, RunPod pod, CoderAI broker, or another service.
A reliability set: ordered, weighted, or failover-capable providers that satisfy the same contract.
A policy entry point: decide which rotation/provider to use based on purpose, privacy, cost, or capability.
Send sensitive support prompts to a local model first. Fall back to a hosted model only when the local route is unavailable and your policy permits it.
{
"providers": ["ollama-local", "hosted-compatible-fallback"],
"rotation": "support-private-rotation",
"mode": "failover",
"autoselect": {
"name": "support-default",
"policy": "prefer_private_then_available",
"allowed_routes": ["support-private-rotation"]
}
}Use a cheap fast model for routine edits, then a stronger model for deep reasoning. Keep both behind a stable app-facing route name.
{
"rotation": "coding-balanced",
"candidates": [
{"provider": "coderai-broker", "weight": 70, "tags": ["code", "low-cost"]},
{"provider": "frontier-hosted", "weight": 30, "tags": ["code", "deep-reasoning"]}
],
"autoselect": {"name": "coding-default", "prefer_tags": ["code"]}
}For image or large local-model tasks, keep a normal provider path and a burst path. Make the route explicit so operators know cost can spike.
{
"provider": "runpod-sdxl-burst",
"base_url": "https://api.runpod.ai/v2/YOUR_ENDPOINT/openai/v1",
"models": ["image:sdui", "llm:large-local"],
"rotation": "gpu-burst-explicit"
}Do not mix chat, embeddings, images, and audio in one route unless every candidate can satisfy the same request shape.
| Workload | Route name | Provider set |
|---|---|---|
| Chat | autoselect:chat-default | OpenAI-compatible chat backends |
| Embeddings | rotation:embed-reliable | Embedding-capable providers only |
| Images | provider:studio-image | Studio/BFInX image endpoint |
| Private | autoselect:private-default | Local/self-hosted first |
# List available route names before changing application code
curl -fsS -H "Authorization: Bearer $AISBF_TOKEN" "$AISBF_BASE/api/u/$AISBF_USER/models"
# Test the exact model string your app will use
curl -fsS -H "Authorization: Bearer $AISBF_TOKEN" -H "Content-Type: application/json" "$AISBF_BASE/api/u/$AISBF_USER/chat/completions" -d '{"model":"autoselect:chat-default","messages":[{"role":"user","content":"route smoke test"}]}'AISBF is open source and also available as a hosted service. During the current testing period, hosted Pro is temporarily available as unlimited access for €2/month.