How karitselmuthu/enterprise_llm_transfomer works
This repository is an educational support-ticket NLP and LLM demo, not a production support integration. Its main workflow classifies a ticket, generates a proposed reply, stores a pending draft, and lets a reviewer approve or reject it; only approval writes a ticket response to local SQLite. The graph also preserves the documented classifier generations and decoder concepts. Edges are limited to README statements and sampled imports/calls; unsampled implementation links are omitted.
Main entry points: main.py FastAPI routes · review.py Draft and response store · decoder.py Causal decoder · generate.py Draft generation
Components 22
Ticket classification
- Classifier runtime
src/inference/runtime.py - V1–V4 baselines
src/baselines - V5 Transformer encoder
src/transformer/model.py - V6–V7 pretrained models
src/inference/pretrained.py - Text tokenization
src/preprocessing/tokenizer.py - Neural vocabulary
src/preprocessing/vocabulary.py
LLM decoder
- Causal decoder
src/llm/architectures/decoder.py - Attention variants
src/llm/attention/variants.py - KV context cache
src/llm/context/cache.py - Expert routing
src/llm/moe/routing.py - Rotary positions
src/llm/positional_encoding/rope.py - Token sampling
src/llm/sampling/strategies.py - Draft generation
src/llm/inference/generate.py - Decoder tokenizer
src/llm/inference/tokenizer.py
Draft review API
- FastAPI routes
api/main.py - Draft and response store
src/llm/inference/review.py
Training and evaluation
- Locked data splits
src/training/split.py - Classifier training
src/training/train.py - Neural training
src/training/train_neural.py - Model evaluation
src/evaluation/evaluate.py
Other components
- Ticket submitter
- Human reviewer
Connections 25
- Ticket submitter → FastAPI routes: submits ticket
README.md - FastAPI routes → Classifier runtime: loads predictor
api/main.py - Classifier runtime → V1–V4 baselines: dispatches versions
src/inference/runtime.py - Classifier runtime → V6–V7 pretrained models: loads V6–V7
src/inference/runtime.py - V1–V4 baselines → Text tokenization: tokenizes text
src/baselines/traditional.py - V1–V4 baselines → Neural vocabulary: uses neural vocabulary
- FastAPI routes → Draft generation: requests suggestion
api/main.py - Draft generation → Causal decoder: generates tokens
src/llm/inference/generate.py - Draft generation → Decoder tokenizer: encodes text
src/llm/inference/generate.py - Draft generation → Token sampling: selects tokens
src/llm/inference/generate.py - Causal decoder → Attention variants: runs attention
src/llm/architectures/decoder.py - Causal decoder → KV context cache: checks cache length
src/llm/architectures/decoder.py - Causal decoder → Expert routing: routes experts
src/llm/architectures/decoder.py - Attention variants → Rotary positions: applies RoPE
src/llm/attention/variants.py - FastAPI routes → Draft and response store: creates draft
api/main.py - FastAPI routes → Draft and response store: serves review
api/main.py - Human reviewer → FastAPI routes: reviews draft
README.md - Draft and response store → Human reviewer: returns draft
README.md - Draft and response store → Draft and response store: writes approved response
src/llm/inference/review.py - Classifier training → Locked data splits: loads locked split
src/training/train.py - Classifier training → V1–V4 baselines: fits V1 model
src/training/train.py - Neural training → Locked data splits: uses split
src/training/train_neural.py - Neural training → V5 Transformer encoder: builds V5 model
src/training/train_neural.py - Model evaluation → Classifier training: loads ticket rows
src/evaluation/evaluate.py - Model evaluation → Locked data splits: checks split fingerprint
src/evaluation/evaluate.py