← Back

Ticket Analyzer

FastAPI service that classifies support tickets using LLMs, returning category, priority, sentiment, and suggested responses.

  • Python
  • FastAPI
  • OpenAI
  • PostgreSQL

Overview

An async FastAPI service that automates support-ticket triage while treating model unreliability as a first-class engineering concern.

Problem

LLM-backed classification is useful for support operations, but model outputs are not inherently trustworthy. A production service needs stable contracts, provider flexibility, and a way to reject malformed responses before they reach callers.

Approach

The service classifies tickets by category, priority, and sentiment, and generates a suggested reply. It keeps the core logic provider-agnostic through an interface boundary and validates model output at multiple layers before returning a response.

Engineering Decisions

The most important design choices behind the project and why they matter.

Abstracted the model provider behind a protocol

Provider-specific code is isolated so the core application can switch model backends without changing the surrounding business logic.

Added dual-layer output validation

The service combines API-level response shaping with Pydantic validation so malformed model output is caught before it escapes the boundary.

Kept the stack asynchronous end to end

Async execution fits I/O-heavy model calls and keeps the service architecture aligned with concurrent request handling.