AISBF Logo AISBF

AI Service Broker Framework — AI Should Be Free

AISBF concepts

Rotation vs Autoselect: AISBF Routing Concepts

Detailed routing tutorial explaining providers, rotations, autoselect policy, weighted failover, privacy classification, and step-by-step route construction.

AISBF production network graphClient appsOpenAI SDK / curlTLS edgenginx / ingressAISBF #1FastAPI workerAISBF #2FastAPI workerMySQLusers + configsRediscache + sessionsCoderAIlocal broker / LANRunPodGPU endpointsHosted APIsOpenAI etc.Workersmodels / GPUsApp sends: POST /api/u/{username}/chat/completions → AISBF authenticates token → resolves route → backend → streamed response.

The mental model

AISBF has three routing layers. Keep them separate or the system gets messy in six months.

Provider = a wire

One backend endpoint plus credentials and model names.

Rotation = reliability

A weighted pool of equivalent model candidates for failover, quota spreading, and cooldown after errors.

Autoselect = policy

A semantic decision layer for private/local, cheap/fast, deep/GPU, or hosted fallback routes.

Build the route step by step

Create direct providers first

Dashboard → User Providers: create stable IDs like coderai-local, runpod-gpu-a, and openai-prod. Test model listing before building rotations.

Create a rotation for equivalent capacity

{"rotations":{"coding-production":{"model_name":"coding-production","providers":[{"provider_id":"coderai-local","model":"qwen2.5-coder:32b","weight":6,"error_cooldown":60},{"provider_id":"runpod-gpu-a","model":"deepseek-coder-v2","weight":3,"error_cooldown":120},{"provider_id":"openai-prod","model":"gpt-4.1-mini","weight":1,"error_cooldown":300}],"privacy":true,"capabilities":["chat","coding","tool_use"]}}}

Create autoselect on top

{"engineering":{"model_name":"engineering","selection_model":"general","fallback":"user-rotation/coding-production","classify_privacy":true,"classify_semantic":true,"available_models":[{"model_id":"user-rotation/coding-production","description":"Private code, logs, secrets, customer data.","privacy":true},{"model_id":"user-provider/runpod-gpu-a/deepseek-coder-v2","description":"Long refactors and GPU-heavy coding when data is not secret."},{"model_id":"user-provider/openai-prod/gpt-4.1-mini","description":"Fast hosted fallback for non-private tasks."}]}}

Call only the policy route from applications

curl -X POST "https://aisbf.cloud/api/u/$AISBF_USERNAME/chat/completions" -H "Authorization: Bearer $AISBF_API_TOKEN" -H "Content-Type: application/json" -d '{"model":"user-autoselect/engineering","messages":[{"role":"user","content":"Fix this failing private test."}]}'

Debugging route choices

Try AISBF

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.