Skip to content
Tech Atlas, home
Search
Esc
  • All roadmapsBrowse every learning path
  • ExploreFind a technology area
  • ProjectsGuided projects and builds
  • My AtlasYour learning dashboard
Guided project · 1 of 3

LLM Ticket Triage Service

A small service that classifies and summarises support tickets with an LLM inside a token budget, with retries, a mock-backed test suite and a measured prompt comparison. It proves you can integrate an LLM API reliably before adding retrieval.

  • Intro
  • 6 milestones · 38 steps in all
  • Quizzes on 7 skills
  • Self-paced

Start with M1: Labelled ticket set. Build it one step at a time; your progress is saved as you go.

What you will build

  • Build a labelled set of synthetic support tickets and validate it against a schema.
  • Call models through one provider-neutral client with timeouts, bounded jittered retries and per-call usage logging, tested offline against a mock.
  • Compare two prompt versions on the labelled set and analyse why they fail.
  • Measure a local open-weight model and a hosted model for accuracy, latency and cost per 1,000 tickets.
  • Serve a token-budgeted endpoint that returns validated JSON, and document setup, design choices and cost in a README.

Tools and ground rules

  • Python 3.12 with Pydantic, httpx, FastAPI, tiktoken and pytest; Ollama serving a small open-weight model (default qwen2.5:1.5b, Apache-2.0).
  • Synthetic tickets, or data under a licence that allows your use; no real personal data in the repository.
  • No paid provider or API key is needed for any milestone except the optional hosted row in M4; the mock provider can stand in for a model throughout.
  • No hard-coded secrets: keys are read from the environment (an untracked .env), and the Git history is scanned before submission.

Getting started

Follow the milestones in order. Each one is a short list of steps you work through and mark done, and ends with a quiz on each skill it used: passing a quiz is what counts as evidence for that skill.

Milestones

From brief to evidence

  1. Milestone 1 · M1

    Labelled ticket set

    At least 50 synthetic or licensed tickets, cleaned and validated against a schema, each with a category label.

    Done when: The validation script passes on the committed data and a reviewer spot-checks 10 labels.

    7 steps
    1. Create the repository and environment
    2. Write the labelling rules before the data
    3. Describe a valid ticket with Pydantic
    4. Write ticket templates, including hard ones
    5. Generate, clean and de-duplicate
    6. Validate the file on disk and report every problem
    7. Test the rules, spot-check 10 labels and commit
  2. Milestone 2 · M2

    LLM client with failure handling

    Provider-neutral client with timeouts, jittered retries and per-call usage logging.

    Done when: Automated tests against a mock provider simulate 429, 500 and timeout responses and pass without network access.

    7 steps
    1. Define a provider-neutral interface
    2. Write a mock provider
    3. Add jittered backoff and a usage log
    4. Wrap any provider in a retrying client
    5. Make the network unreachable in tests
    6. Simulate 429, 500 and timeouts
    7. Test the waits and the log, then commit
  3. Milestone 3 · M3

    Prompt versions compared

    Two prompt versions with accuracy on the labelled set and three analysed failures.

    Done when: A reviewer re-runs the comparison script and obtains the reported accuracy within run-to-run variance.

    7 steps
    1. Serve a small open-weight model locally
    2. Talk to any OpenAI-compatible server
    3. Test the HTTP mapping without a server
    4. Choose the model with one setting
    5. Write two prompt versions
    6. Compare both prompts on every ticket
    7. Analyse three failures and keep the better prompt
  4. Milestone 4 · M4

    Hosted versus local model

    The better prompt run on the labelled set against one hosted model and one locally served open-weight model through the same client, with accuracy, latency and estimated cost per 1,000 tickets.

    Done when: A reviewer switches models with one configuration change and reproduces both result rows.

    6 steps
    1. Document every setting in .env.example
    2. Read prices from the configuration
    3. Measure accuracy, latency and cost per 1,000 tickets
    4. Benchmark the local model
    5. Benchmark a hosted model (optional)
    6. Write up the comparison and commit
  5. Milestone 5 · M5

    Budgeted HTTP endpoint

    Endpoint that returns category and summary as validated JSON and rejects inputs over the token budget.

    Done when: Automated tests check the response schema and the over-budget rejection; a secret scan finds no API key in the repository.

    6 steps
    1. Allocate a token budget
    2. Triage one ticket, with one retry for bad JSON
    3. Expose POST /triage
    4. Test the response schema and the over-budget rejection
    5. Run the service and call it with curl
    6. Commit, then scan the history for secrets
  6. Milestone 6 · M6

    README with cost estimate

    README covering setup, design choices and estimated cost per 1,000 tickets.

    Done when: A second person runs the service from the README; the cost estimate is consistent with logged token usage.

    5 steps
    1. Summarise the usage log
    2. Check your estimates against the logged counts
    3. Write the README: setup, use and cost
    4. Explain the design choices and limits
    5. Run it from a fresh clone, then hand it over

A project worth finishing

Finish all 6 milestones and pass their quizzes to demonstrate the skills this project uses. Next in the series: Retrieval Benchmark for a Docs Corpus.