Let’s talk about your projectLet’s talk
Back to projects

Training project · Text classification · ML & LLMs

ZenAssist
A complaint arrives. The adviser stays in control.

Complaint classification using Python and scikit-learn, with a model served through FastAPI and a Next.js interface. A practical comparison of machine learning and LLMs, through to application integration.

A project presented by Joseph Truffinet, founder of Keseul.

ZenAssistExplore the application.
Open full screen

An embedded version built from the application’s code, with no account to create. The actual TF-IDF and logistic regression model classifies fictional examples or your own text. It was trained on English financial complaints across 18 categories. Around 9 MB is loaded for the first analysis. Processing runs on your device, without sending your text or calling an LLM. Changes remain in this session.

BEHIND THE PROJECT

Do you need an LLM to classify client complaints?

A suggested category to help sort complaints, with confirmation or correction by the adviser.

UNDERSTAND

The starting point.

Reading and classifying every complaint takes adviser time. An incorrect category can also complicate case handling.

DESIGN & BUILD

The project in practice.

Comparison of machine learning models and LLMs, followed by two integrations in the Next.js starter. An LLM connection through OpenRouter and a linear model trained in Python and exposed through FastAPI. The adviser approves the category before it is saved in PostgreSQL.

  • Next.js
  • React · JavaScript
  • Python
  • FastAPI
  • scikit-learn
  • TF-IDF
  • Logistic regression
  • OpenRouter
  • PostgreSQL

Project scope.

Model training and evaluation, server-side LLM integration, a Python inference service and a validation flow in the existing Next.js interface.

Train a linear model
Text vectorisation with TF-IDF, followed by scikit-learn logistic regression with class weighting. The model is selected using validation macro F1 and evaluated on a separate test set.
Move from a notebook to the application
The pipeline is exported with its version and metadata, then loaded when FastAPI starts. Next.js sends text to the Python service. The predicted category, from 18 options, remains a suggestion until confirmation in PostgreSQL.
Compare with an LLM approach
Another version connects OpenRouter through an OpenAI-compatible API, with examples in the prompt, a structured response and category validation. The choice between ML and an LLM depends on quality, latency and cost.

WHAT CHANGES

Assisted sorting, with the adviser making the final decision.

Quality, response time and cost guide the choice of approach. The adviser can correct the suggestion before confirming it.

Discuss a similar need

WHAT ABOUT YOUR BUSINESS?

A similar need
in your business?

Can text be classified without using LLM tokens?

Yes. This demo runs the actual TF-IDF and logistic regression model in your browser using its scikit-learn-trained parameters. Text stays on your device and no LLM provider is called. The model covers 18 English financial complaint categories and is not a general-purpose classifier. The original project’s Python/FastAPI service is replaced here by local inference whose predictions were compared with Python’s.

How do you compare an ML model and an LLM for ticket classification?

Use a shared, independent test set, define criteria before comparing and examine errors by category. Overall quality, class balance, latency and cost measure different things. Measurement conditions should be specified.

Is a predicted category enough to route the ticket to the right team?

No. A product category does not necessarily identify the recipient team. Define that business mapping, handle ambiguous cases and decide when the adviser should confirm or correct the suggestion.

Let’s start with what weighs you down.

Which task would you like
off your list next Monday?

Describe your daily work and tools. Together, we’ll identify what is worth simplifying, automating or delegating.

Discuss what’s slowing me down

Joseph · your point of contact

Let’s start with what slows you down.

A few questions to prepare a conversation about your needs.

Step 1 of 4

What’s slowing you down today?

Choose the closest situation to continue.