A production-minded backend for managing, rendering, validating, and executing reusable AI prompts.
π§ Prompt Management β’ π‘οΈ Guardrails β’ π€ AI Execution β’ π Evaluation β’ π¦ Docker β’ π CI
Smart Prompt Studio is a FastAPI-based backend built around one simple idea:
Treat prompts like backend-managed application assets, not random strings buried inside code.
Instead of scattering prompts throughout an application, this service provides a central layer for:
- π Creating prompts
- π’ Managing prompt versions
- π§© Rendering variables
- π‘οΈ Validating prompts before execution
- π€ Sending prompts to an AI provider
- π Tracking execution behavior
- π§ͺ Testing failure paths
- π Evaluating prompt behavior
- πͺ΅ Logging requests and services
- π³ Running inside Docker
- π Validating changes through GitHub Actions
The project is intentionally small.
The engineering lessons are not.
π Prompt Management
Create reusable prompts through the API.
POST /prompts
Prompts contain structured messages instead of one giant string.
This keeps prompt construction explicit and maintainable.
The goal is to build a clean foundation for AI-powered backend systems.
Smart Prompt Studio focuses on the engineering layer surrounding an LLM:
Client
β
βΌ
FastAPI API
β
βΌ
Prompt Service
β
βββ Versioning
βββ Variable Rendering
βββ Validation
β
βΌ
Guardrail Service
β
βΌ
AI Service
β
βΌ
AI Provider
β
βΌ
Response
The project follows a service-oriented FastAPI structure.
Smart-Prompt-Studio/
β
βββ app/
β βββ config.py
β βββ logging_config.py
β βββ main.py
β βββ schemas.py
β β
β βββ exceptions/
β β βββ custom_exceptions.py
β β βββ handlers.py
β β
β βββ middleware/
β β βββ __init__.py
β β βββ request_logging.py
β β
β βββ services/
β βββ ai_service.py
β βββ guardrail_service.py
β βββ prompt_service.py
β
βββ tests/
β βββ test_ai_service_errors.py
β βββ test_ai_service_logging.py
β βββ test_prompt_evalutation.py
β
βββ .github/
β βββ workflows/
β βββ ci.yml
β
βββ .dockerignore
βββ .env.example
βββ .gitignore
βββ Dockerfile
βββ requirements.txt
Technology Purpose
-π Python Application language
-β‘ FastAPI API framework
-π¦ Pydantic Data validation
-π€ OpenAI-compatible SDK AI communication
-π§ͺ Pytest Automated testing
-π³ Docker Containerization
-π GitHub Actions CI
-πͺ΅ Python Logging Observability
-πΏ Git Version control
ββββββββββββββββββββββββββββββββ
β Smart Prompt Studio β
ββββββββββββββββββββββββββββββββ€
β Prompt Management β
β
β Versioning β
β
β Variable Rendering β
β
β Guardrails β
β
β AI Integration β
β
β Error Handling β
β
β Logging β
β
β Automated Tests β
β
β Docker β
β
β GitHub Actions CI β
β
ββββββββββββββββββββββββββββββββ
Local test suite:
10 passed
CI:
β
Passed
Docker:
β
Verified
Smart Prompt Studio is a compact AI backend focused on one principle:
Build the engineering around the model, not just the model call.
It combines:
β‘ FastAPI
π§ Prompt Management
π‘οΈ Guardrails
π€ AI Execution
πͺ΅ Logging
π§ͺ Testing
π³ Docker
π CI
πΏ Git
Small enough to understand.
Structured enough to extend.
Practical enough to build upon.
Made as part of a hands-on journey toward production-grade AI Backend Engineering.
Code β Test β Containerize β Automate β Ship
Smart Prompt Studio
The prompt is only the beginning.