One front door for all my AIs: building a "Director"
At some point I had several AI boxes, several models, and several apps that all wanted to talk to them. Every time I opened a chat, I had to decide which model to use. I didn't want to. I wanted one front door.
So I built one and called it the Director.
Version 1: a switchboard
The Director is a small service running on my data server. It doesn't need a GPU. Apps don't ask for a specific model. They ask for a kind of model: a sorter, a writer, vision, speech. The Director:
- picks a box that's up and not overloaded,
- enforces limits so one job can't hog everything,
- logs every single call.
I looked at an off-the-shelf gateway that does something similar, but there had been a reported compromise of that package earlier in the year. My data server is the most sensitive machine I have, so I wrote my own. It's smaller than you'd think.
Version 2: the only way in
Then I made it the only door. My chat app (Open WebUI) can reach models, voice, documents and search only through the Director. I didn't rely on a setting for that. I enforced it with a firewall rule, because settings get changed and firewalls don't forget.
The default model in my chat window is now just called "Director." When I ask something:
- Simple code rules take the first crack at it.
- If the rules can't decide, a small, fast model makes one quick call and picks a lane:
- Business goes to Emily, my analyst, who has the data tools.
- Personal goes to Susan, my personal assistant.
- General goes to a quick-answer lane.
- When it's unsure, it sends the question to the business analyst. A wrong business answer is the expensive mistake, so that's the lane that gets the benefit of the doubt.
My rule now: I always use the Director. If a new ability can't be reached through it, it doesn't count as done.
How well does the traffic cop work?
- Accuracy: 71 of 72 on the first test set. On a fresh 47-question set, 44 of 47, then 46 of 47 after adding a couple of rules. All 54 business questions went to the right place.
- Speed: about one second per decision.
- Why not just keywords? I tried. Keyword-only routing scored 102 of 119. The small model earns its keep.
- Overhead: none I could measure. Speech took 0.6–0.7 seconds and transcription about 1.8 seconds, with or without the Director in the path.
Adding a coder lane
I wanted a lane for coding help, so I had two of my boxes compete:
| Round | Bigger model | Smaller, faster model |
|---|---|---|
| Easy | 9 / 10 | 9 / 10 |
| Hard | 42 / 42 | 32 / 42 |
| Harder | 48 / 48 | 33 / 48 |
On easy stuff they tie. On hard stuff it's not close. Coding now goes to the bigger model, with the small one as a fallback.
Since then I've added a permissions table, so each app gets only the tools its key allows (no row, no access), plus music and sound-effect tools.
Faceplants
Rain on a tin roof. I asked the Director for "the sound of rain on a tin roof." It routed me to a lane that didn't have the sound tool and replied "I cannot." The tool existed. The route didn't. Fixed the same day, and the next try worked in about three minutes. Lesson: if a lane doesn't have the tool, a request must never land there.
Voice uploads broke on day one. My chat app sends audio in pieces, and my tests had only ever sent whole files. Test the way the real app behaves.
A restart ate my answer. I restarted the chat app while a question was running and lost the reply. Now restarts wait until the server is idle.
Does all that traffic need more hardware?
My backup box handled 3,146 calls in 14 days and was busy about 4% of the time. So no, not yet. Measure before you buy.
What I'd tell you
- You don't want to pick models. You want one front door.
- Enforce it with a firewall, not a setting.
- A cheap, fast model makes a great traffic cop.
- Test every new ability through the front door, the way you'll actually use it.