Home · Designing an AI Gateway for Enterprises · Part 16 of 17
What I'd tell you before you build one
Seven opinions, held strongly, open to argument.
Fifteen posts in, here's the whole picture in one place, and the short list of things I'd say to anyone about to start. It is one product: a gateway that decides, and a portal that explains, sitting on a handful of building blocks.
The building blocks
Four pieces carry most of the weight:
- Azure API Management is the door.
- Microsoft Foundry is where the models live.
- Azure Container Apps runs the portal.
- PostgreSQL remembers what happened.
The real architecture has more parts than the four above and more than the picture shows. I've left those out on purpose. They matter to the build, not to the argument.
The seven
- Start with the three questions. Who spent what, how much, what went wrong. Everything else follows.
- Keep the front door boring and the rules in one place. Every exception is a future incident. Serve every consumer through the same door, whether it's a desktop chat client, a terminal agent, an editor or your own application.
- Build the door and its control room as one product. But never let the control room be able to take the door down.
- Treat identity as its own product. Separate who someone is from what they may do, and don't merge people quietly.
- Design the answer before the log. If nobody can say what question a record answers, don't keep it.
- Test the real path after every change. "Succeeded" is not "works".
- Write down every workaround, with its exit. Mine is small, has one job, and has its exit written down.
What I'd do again
Name the three questions on day one. Put money, not tokens, at the centre of every number. Insist that the gateway and its portal share one idea of a request, a person and a model, so that a figure means the same thing wherever it appears. And measure at the point where the truth is known.
What I'd do differently
I'd write the exit note for every workaround on the day I wrote the workaround. I'd test the fallbacks earlier and more often. And I'd draw the whole picture sooner, because the moment you can see it on one page, you start noticing which parts you were treating as separate products by accident.
Why one product matters
The thread through the whole series is the join between the two halves. The relay writes records that the portal reads. The portal sets budgets that the gateway applies. Identity decides what both show. Health watches the whole path. Take any one of those links away and the rest still work, but the product stops being able to explain itself. That's the difference between a gateway and a gateway you can trust.
If you only remember one thing from the series, make it this: the door and the control room are one product. Build them, test them and describe them that way.
Now it's your turn
Which of these do you disagree with? Which have I missed? If you've built something similar, I'd like to hear what you did differently, and why. I'm especially curious about the places where you drew the line differently: what you chose to record, where you put the exit for a workaround, how you handled identity for people outside your own directory.
Tell me which one you'd argue with first.
Want to discuss this? Connect with me on LinkedIn.
Next: what this series didn't cover.