open model · language

Versalit SAC-1

A language model built entirely from scratch — tokenizer, Mixture-of-Experts architecture, training and benchmark, all in pure PyTorch. Made for customer service and sales in Brazilian Portuguese.

Apache-2.012.4M parametersMixture-of-ExpertsPT-BR
versalit-sac-1 · python generate.py --demo
cliente: meu pedido nao chegou e ja passou do prazo sac-1: sinto muito pelo atraso ! pode me informar o numero do pedido para eu verificar ? cliente: ola, quero saber o preco do nosso plano premium sac-1: ola ! que bom que voce se interessou pelo nosso plano premium ! ele inclui acesso ilimitado a todos os recursos , suporte prioritario 24 horas e atualizacoes gratuitas . cliente: quero cancelar minha compra sac-1: a troca de tamanho e gratuita ! vou iniciar o processo .
Real output from python generate.py --demo, in Portuguese. The model continues the customer's line (in italics) and replies as the agent; sampling uses temperature 0.8, so every run differs. In order: "my order hasn't arrived" → it asks for the order number; "I want to know the price" → it describes the premium plan; "I want to cancel my purchase" → the limit shows: instead of handling the cancellation, it answers about a free size exchange.

What it is

A Small Language Model with a Mixture-of-Experts architecture: each token is routed to 2 of 8 experts — the same principle behind Mixtral. It uses RoPE, RMSNorm, SwiGLU, weight tying and a BPE tokenizer trained from scratch on the domain itself.

No pre-trained model, no fine-tuning, no LLM framework: tokenizer, architecture, training and benchmark were written by hand in pure PyTorch. The only dependency is torch.

How Mixture-of-Experts works

In a regular transformer every token goes through the same feed-forward layer. In MoE, that layer becomes 8 experts, and a router learns, token by token, which 2 to call. That is why the model has 12.4 million parameters in total, but only about 5 million work on each token.

A load balancing loss is added during training so the router does not send everything to the same experts. In SAC-1, layers 0, 2 and 4 are MoE and layers 1, 3 and 5 are dense — six blocks in total.

Embedding (1,024 tokens, 256 dim)
  └─ 6 transformer blocks
       RMSNorm → causal attention (8 heads, RoPE)
       RMSNorm → SwiGLU FFN
         blocks 0, 2, 4: MoE, 8 experts, top-2
         blocks 1, 3, 5: dense
  └─ RMSNorm → LM head (weights tied to the embedding)

Benchmark — 904 questions, 8 categories

CategoryScore
Exact FAQ100%
Multi-turn conversation100%
Sales objection100%
Sales script86.5%
Sentence completion85.9%
Paraphrased FAQ80.5%
Domain relevance75%
Intent classification68.4%
Composite score85.7%

How to read it: overall, 87.8% of answers contain the expected information, 98.9% are coherent and 84.8% stay within the customer-service domain. The weak spot is paraphrased intent — the model memorizes more than it generalizes, and we publish that.

Training

ParameterValue
GPUNVIDIA RTX 3060 (12 GB)
OptimizerAdamW (β 0.9 / 0.95)
Learning rate3e-4, 500-step warmup + cosine
Batch64
Precisionmixed (FP16)
Final loss (train)0.25
Final perplexity1.3
Data~3,900 synthetic customer-service and sales texts

How to run

git clone https://huggingface.co/delvek/versalit-sac-1
cd versalit-sac-1
pip install torch
python generate.py          # interactive chat
python generate.py --demo   # demo
python benchmark_qa.py      # runs the 904-question benchmark

Honest limitations

  • Trained on ~3,900 synthetic texts — production use needs real data from your support team.
  • 1,024-token vocabulary: out-of-domain words become <unk>.
  • 256-token context — long conversations get truncated.
  • Brazilian Portuguese only — that is all it was trained on.
  • It is a proof of concept of the MoE architecture, not a production chatbot.