- Result
- Token cost down 83%
- Duration
- 12 days
- Platform
- A public assistant, a client portal and an AI hub for lawyers
From the project


A legal memo drafted by the assistant, left for the lawyer to review before use (demo text) 
The legal assistant talks with a visitor and sorts the request before passing it to a lawyer (firm name hidden, demo chat) 
The client portal: invoices due, upcoming hearings and the latest documents (demo data) 
A case in the client portal: hearings, shared documents and invoices (demo data)
Where the money went
- The AI hub was open to anyone with the link: text, images, video, audio and PDF analysis, with no sign-in and no record.
- The public assistant trusted the conversation the browser sent, with no limit on length or on requests.
- The portal chat saved each raw streamed reply, markers and all, and resent all of it with every question.
- Any client who signed up could call the model without limit, and every repeated question went to the model.
What I changed
- The AI hub is now for permitted users only, with a daily limit per user, and every request is written to a usage log.
- I removed images, video and audio: the firm did not need them, and they cost the most.
- The server now owns the conversation, with a limit of 10 requests a minute per IP address.
- Ready answers to repeated questions, which the firm edits itself, and a policy that keeps the assistant on legal matters.
- I fixed the stream parsing; the firm then chose to move client contact to tickets answered by a lawyer.
How I checked
Tests check that a client account cannot reach the AI chat, that the assistant ignores fake replies sent by the browser, that the 11th request in a minute is refused, and that the daily limit stops a user. The result on the bill: token cost down 83%.
Built with
Python (FastAPI)ReactLLM API
Services in this work
- Maintaining an existing systemYour system runs but keeps breaking, the bills keep growing and you do not know why, or the person who built it is gone? I take over your existing app or system, find the root cause, fix it, and carry on with you.
- Web platform developmentA custom web app your customers and team use from the browser on any device: a customer portal, a subscription platform you sell to companies, or a company site with quote requests, tracking and calculators. In Arabic and English from day one.
Related work
- A point-of-sale system with e-invoicingA client in Saudi Arabia runs one point-of-sale system for several stores. Invoices printed with a QR code, but when it came to sending them to the tax authority's platform, they were rejected. I built the signing, the certificates and a chain per store, and the invoices were accepted.
- AMRONECAn engineering and industrial company in Saudi Arabia. I built its website in Arabic and English with a hub of engineering tools, and I am building its ERP in phases, covering accounts, sales, contracts and billing.
- Blue WingA sourcing and shipping company working from China to the Arab world. I built its site, Arabic first: customers ask for a quote and follow their shipment by one number, and the company runs quotes, shipments and customers from one admin.
Tell me what you want built.
I reply within one working day, with questions or a first idea of scope and price.
Send me your idea
or write to me at hello@muhandis.online
