---
title: "Private AI: Training, Self-Hosting & Secure APIs | QCS"
description: "How we train open-weight models on your data, suggested models for quoting, support, OCR and data entry, and self-hosting behind a secure AI gateway."
url: https://quarkcs.com/private-ai
---
SLM / LLM · Training, self-hosting & secure APIs

# Your knowledge. *AI that fits.*

Start with the task, then choose the model. We adapt open-weight models to your data, host them on infrastructure you control and expose them through secure APIs your systems can call.

[Discuss a private AI pilot](https://quarkcs.com/contact?interest=private-ai) See suggested models

Choose the right intervention

## Know when to retrieve.
Know when to adapt.

01 / Retrieval

### Bring the knowledge.

Give a model relevant documents or records as context. Retrieval does not change model weights.

02 / Fine-tuning

### Shape the behaviour.

Update model weights using selected examples when the task and evaluation justify it.

03 / Deployment

### Choose the boundary.

Map where inputs, outputs, logs and tool calls go. Choose infrastructure to match the agreed requirements.

SLM: small language model. LLM: large language model. We adapt existing open-weight models rather than training foundation models from scratch.

How we train models

## Evaluation first. *Training only where it pays.*

Each step leaves a record: the dataset, the adapter, the evaluation report and the decision to ship or stop.

1. 01 · Define

   ### Fix the task and the test

   Agree the task, the output format and what counts as correct. Build a test set from real, recent records before any training starts.
2. 02 · Prepare

   ### Collect and redact

   Gather the agreed sources (email, chat, ERP records, documents) under a data-processing agreement. Remove duplicates and replace personal data with placeholders.
3. 03 · Pair

   ### Label with real outcomes

   Pair each input with the result your team approved: the quote sent, the ticket answer, the posted invoice. Add reviewed synthetic examples for rare cases.
4. 04 · Baseline

   ### Try without training

   Test prompting, retrieval and schema-constrained output on base models. If that meets the bar, we stop here and save the training cost.
5. 05 · Fine-tune

   ### Adapt with LoRA

   Supervised fine-tuning with LoRA or QLoRA adapters on dedicated GPUs. The base model stays unchanged; each adapter is small, versioned and reversible.
6. 06 · Align

   ### Learn from corrections

   Use reviewer edits as preference data (DPO), and reward verifiable results such as valid schemas and real item codes (GRPO).
7. 07 · Evaluate

   ### Prove it on held-out data

   Score task accuracy per language and segment, check for regressions in general ability and test for unsafe output. Ship only if it beats the baseline.
8. 08 · Operate

   ### Monitor and retrain

   Quantise for serving, register the version, watch for drift and retrain on newly approved outcomes on an agreed schedule.

- Supervised fine-tuning
- LoRA / QLoRA
- DPO
- GRPO
- Reviewed synthetic data
- FP8 / AWQ quantisation
- Unsloth · TRL · Axolotl

Suggested models by business task

## The right size *for each job.*

Our current starting points. Every pilot re-runs the comparison on your own data before a model is chosen.

01 · Quoting & sales

### Quotes from informal requests

Read requests from email and WhatsApp, map informal product names to catalogue items, flag what is missing and draft the reply. Prices stay in the ERP.

- **Qwen3.8-27B**, LoRA fine-tuned Request extraction, item mapping, reply drafts
- **Qwen3-Embedding + Qwen3-Reranker** Catalogue and customer-history retrieval

Single GPU · 48–80 GB

02 · Customer support

### Grounded answers, agent approved

Triage tickets, find the relevant knowledge-base articles and draft replies for an agent to review and send.

- **Gemma 4 26B A4B** Fast mixture-of-experts model for drafting
- **BGE-M3 + reranker** Multilingual knowledge-base search
- **Qwen3Guard** Screens inputs and outputs

Single GPU · 48 GB

03 · OCR & document parsing

### Scans into structured text

Turn scanned invoices, purchase orders, delivery notes and forms into text, tables and layout for the next step.

- **PaddleOCR-VL** (0.9B) Layout, tables and multi-language text
- **DeepSeek-OCR** Alternative for dense printed documents
- **Qwen3.8-27B** (vision) Hard cases: handwriting, stamps, poor scans

Small GPU · 16–24 GB

04 · Data entry & extraction

### Records filled, fields validated

Create ERP records from documents and messages, such as supplier invoices, sales orders and customer details, with every field checked against a schema.

- **Gemma 4 E4B**, fine-tuned High-volume field extraction
- **Qwen3.8-27B** Escalation for low-confidence records
- **JSON-schema constrained decoding** Output always parses; the ERP validates it

Small GPU · 16–24 GB

05 · Classification & routing

### Sorted before work starts

Tag incoming email and chat by intent, language, urgency and owner so the right workflow or person picks it up.

- **Gemma 4 E2B or E4B**, fine-tuned Low-latency classifier
- **Qwen3-Embedding** (0.6B) Similarity routing and duplicate detection

Small GPU or CPU

06 · Internal knowledge search

### Answers with sources

Answer staff questions from policies, SOPs, contracts and project documents, citing the source of each answer.

- **Qwen3-Embedding + Qwen3-Reranker** Retrieval, sized from 0.6B to 8B
- **Gemma 4 31B** or **Qwen3.8-27B** Answer generation with citations

Single GPU · 48–80 GB

07 · Agentic workflows

### Multi-step work with approved tools

Plan tasks and call approved tools in ERPNext and other systems, within the agent's permissions and approval rules.

- **gpt-oss-120b** Open-weight reasoning model with tool calling
- **Qwen3.8-27B** When the agent also reads images or documents

Single GPU · 80 GB

08 · Voice & call notes

### Speech into records

Transcribe calls and voice messages, including WhatsApp voice notes, for summaries and CRM updates.

- **Whisper large-v3-turbo** Broad language coverage
- **Parakeet-TDT-0.6B-v3** Faster; English and European languages
- **Qwen3-ASR** Wide multilingual coverage

Small GPU · 16–24 GB

Starting points as of November 2026. Open-weight models are released every few months, so the list is reviewed regularly. We check each model's licence before use. Hardware shows a typical size class for quantised serving, not a quote.

Self-hosting & secure APIs

## One API for your systems. *Every model behind it.*

Applications call one internal, OpenAI-compatible endpoint. The gateway decides who may use which model, and records each call.

1. Applications

   ### ERPNext, CRM, portals and agents

   Call the gateway with their own scoped credentials. No application holds a model server address or a shared key.
2. AI gateway

   ### Identity, limits, guardrails and audit

   LiteLLM or Envoy AI Gateway: a key per application, sign-in through your identity provider, per-model access, rate limits and budgets, input and output screening, and a log of every request.
3. Inference

   ### vLLM or SGLang

   Continuous batching, FP8 quantisation, several LoRA adapters served on one base model, and JSON-schema constrained output.
4. Infrastructure

   ### GPU servers you control

   On a private network with no public endpoint. Model servers accept traffic only from the gateway, and outbound internet access is blocked.

Option A

### On-premises

GPU servers in your data centre or office rack. Suits strict data-residency rules and steady, predictable workloads.

Option B

### Your cloud tenancy

GPU instances in your own cloud account and region, inside a private network. You keep the account, the keys and the bill.

Option C

### Regional GPU provider

Dedicated GPUs from a provider in your chosen jurisdiction, for pilots or capacity spikes, with the same gateway and controls.

Security controls

## Secure by configuration. *Checked before go-live.*

The controls we set up and review with your team before production traffic reaches a model.

### Identity

Single sign-on (OIDC) for people, scoped and rotated keys for applications, role-based access to each model.

### Network

TLS at the edge, mutual TLS between gateway and model servers, private subnets, no public model endpoints, blocked outbound traffic.

### Data

Prompts and outputs retained under your policy, personal data redacted before logging, encryption at rest, and no training on production data without approval.

### Guardrails

Safety screening of inputs and outputs, prompt-injection checks on retrieved and tool content, schema validation and tool allow-lists.

### Observability

OpenTelemetry traces, Prometheus and Grafana metrics, and self-hosted Langfuse for prompt and response review, with alerts for latency, errors and GPU load.

### Supply chain

Weights from official publishers only, safetensors format, pinned checksums, licence review, and staged upgrades with a rollback path.

The engagement

## A clear scope.
A useful outcome.

Agreed test tasks, evaluation results and a deployment recommendation.

1. 01

   ### Define success

   Agree representative tasks, data access and an evaluation baseline.
2. 02

   ### Compare approaches

   Test prompting, retrieval and model adaptation against the same tasks.
3. 03

   ### Adapt where useful

   Scope domain fine-tuning when the evaluation supports changing model behaviour.
4. 04

   ### Plan operation

   Review quality, latency, infrastructure, data flows and ongoing monitoring.

Put the model in context

## See the task. *Then place the model.*

Follow the AI audit and revision stages in Lead to Quote, or review model access and data boundaries in the architecture.

[Business workflow: AI review in Lead to Quote →](https://quarkcs.com/agentic/lead-to-quote#stage-5)

[Technical reference: the model gateway →](https://quarkcs.com/agentic/architecture#layer-7)

[Cost estimator: your own models against Claude, OpenAI and DeepSeek →](https://quarkcs.com/automation-cost-estimator)

## What does your model need to do?

[Discuss a private AI pilot](https://quarkcs.com/contact?interest=private-ai) [See AI review in a workflow](https://quarkcs.com/agentic/lead-to-quote#stage-5)
