โ† All posts

Production AI System Architecture

Production AI System Architecture

Most AI projects start with a model.

Production AI systems donโ€™t.

They start with ๐—ฎ๐—ฟ๐—ฐ๐—ต๐—ถ๐˜๐—ฒ๐—ฐ๐˜๐˜‚๐—ฟ๐—ฒ.

A production-grade AI system needs much more than an LLM:

โ†’ ๐—จ๐—œ / ๐—ฐ๐—น๐—ถ๐—ฒ๐—ป๐˜๐˜€ to interact with users
โ†’ ๐—”๐˜‚๐˜๐—ต๐—ฒ๐—ป๐˜๐—ถ๐—ฐ๐—ฎ๐˜๐—ถ๐—ผ๐—ป to control access
โ†’ ๐—Ÿ๐—ผ๐—ฎ๐—ฑ ๐—ฏ๐—ฎ๐—น๐—ฎ๐—ป๐—ฐ๐—ถ๐—ป๐—ด + ๐—”๐—ฃ๐—œ ๐—ด๐—ฎ๐˜๐—ฒ๐˜„๐—ฎ๐˜† to handle traffic reliably
โ†’ ๐—ข๐—ฟ๐—ฐ๐—ต๐—ฒ๐˜€๐˜๐—ฟ๐—ฎ๐˜๐—ถ๐—ผ๐—ป + ๐—ฎ๐—ด๐—ฒ๐—ป๐˜๐˜€ to manage workflows
โ†’ ๐—ง๐—ผ๐—ผ๐—น๐˜€ + ๐—ฟ๐—ฒ๐˜๐—ฟ๐—ถ๐—ฒ๐˜ƒ๐—ฎ๐—น to connect AI to the real world
โ†’ ๐——๐—ฎ๐˜๐—ฎ๐—ฏ๐—ฎ๐˜€๐—ฒ๐˜€ for conversations, knowledge, logs and state
โ†’ ๐—–๐—น๐—ผ๐˜‚๐—ฑ ๐—ผ๐—ฟ ๐—ผ๐—ป-๐—ฝ๐—ฟ๐—ฒ๐—บ ๐—บ๐—ผ๐—ฑ๐—ฒ๐—น๐˜€ depending on the requirements
โ†’ ๐—–๐—ฎ๐—ฐ๐—ต๐—ถ๐—ป๐—ด + ๐—พ๐˜‚๐—ฒ๐˜‚๐—ฒ๐˜€ to improve performance and resilience
โ†’ ๐—˜๐˜ƒ๐—ฎ๐—น๐˜‚๐—ฎ๐˜๐—ถ๐—ผ๐—ป to continuously measure quality
โ†’ ๐—ฃ๐—ฟ๐—ผ๐—บ๐—ฝ๐˜ / ๐—บ๐—ผ๐—ฑ๐—ฒ๐—น ๐—บ๐—ฎ๐—ป๐—ฎ๐—ด๐—ฒ๐—บ๐—ฒ๐—ป๐˜ to control changes and versions
โ†’ ๐—Ÿ๐—Ÿ๐—  + ๐—ถ๐—ป๐—ณ๐—ฟ๐—ฎ๐˜€๐˜๐—ฟ๐˜‚๐—ฐ๐˜๐˜‚๐—ฟ๐—ฒ ๐—บ๐—ผ๐—ป๐—ถ๐˜๐—ผ๐—ฟ๐—ถ๐—ป๐—ด to understand what happens in production
โ†’ ๐—ฆ๐—ฒ๐—ฐ๐˜‚๐—ฟ๐—ถ๐˜๐˜† + ๐—ณ๐—ฎ๐—น๐—น๐—ฏ๐—ฎ๐—ฐ๐—ธ๐˜€ when things go wrong

The interesting part is that ๐—ป๐—ผ๐—ป๐—ฒ ๐—ผ๐—ณ ๐˜๐—ต๐—ฒ๐˜€๐—ฒ ๐—ฐ๐—ผ๐—บ๐—ฝ๐—ผ๐—ป๐—ฒ๐—ป๐˜๐˜€ ๐—ถ๐˜€ ๐˜๐—ต๐—ฒ โ€œ๐—”๐—œ ๐˜€๐˜†๐˜€๐˜๐—ฒ๐—บโ€ ๐—ฏ๐˜† ๐—ถ๐˜๐˜€๐—ฒ๐—น๐—ณ.

The AI system is the set of relationships between them.

And there is no single correct stack.

You might use:

  • APISIX or another API gateway
  • PostgreSQL or another application database
  • Elasticsearch or another log platform
  • Redis or another cache / queue
  • Keycloak or another identity provider
  • Prometheus + Grafana or another observability stack
  • cloud models or self-hosted/on-prem models

The tools change.

The architectural principles don't.

๐—ฃ๐—ฟ๐—ผ๐—ฑ๐˜‚๐—ฐ๐˜๐—ถ๐—ผ๐—ป ๐—”๐—œ ๐—ถ๐˜€ ๐—ป๐—ผ๐˜ ๐—ฎ๐—ฏ๐—ผ๐˜‚๐˜ ๐—ด๐—ฒ๐˜๐˜๐—ถ๐—ป๐—ด ๐—ฎ๐—ป ๐—Ÿ๐—Ÿ๐—  ๐˜๐—ผ ๐—ฎ๐—ป๐˜€๐˜„๐—ฒ๐—ฟ ๐—ฎ ๐—ฝ๐—ฟ๐—ผ๐—บ๐—ฝ๐˜.

It's about building a system that remains reliable, observable, secure and cost-effective ๐—ฎ๐—ณ๐˜๐—ฒ๐—ฟ ๐˜๐—ต๐—ฒ ๐—ฑ๐—ฒ๐—บ๐—ผ ๐—ฒ๐—ป๐—ฑ๐˜€.

I put together this architecture diagram to make those relationships easier to reason about.

What would you add or change in this architecture?

#AIEngineering #ProductionAI #LLM #GenerativeAI #SoftwareArchitecture #MLOps #LLMOps #AIInfrastructure

Originally published on LinkedIn.

Turn your expertise into LinkedIn posts like this one.

Try Postars free โ†’
Production AI System Architecture โ€” Postars