Run this model with HF Jobs

Run M37labsorg/Anvaya-4B on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/M37labsorg/Anvaya-4B. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/M37labsorg/Anvaya-4B on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/M37labsorg/Anvaya-4B. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/M37labsorg/Anvaya-4B. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.

Anvaya-4B

Fine-tuned locally with SLM Forge on 2026-11-20.

Goal: A 4B specialist that reads a commercial contract and returns structured, span-grounded JSON for 20 high-value clause types, on-premise. Base model: mlx-community/Qwen3-4B-Instruct-2507-4bit Runs on: Apple Silicon Macs with 8 GB unified memory or more.

Lineage

  1. SFT (job 11): train_loss 0.051, peak_mem_gb 3.55, val_loss_start 1.717, val_loss 0.178
  2. DPO (job 12): train_loss 0.009, peak_mem_gb 6.45, reward_accuracy 1.0, val_loss_start 0.693, val_loss 0.175
  3. DPO (job 13): train_loss 0.274, peak_mem_gb 6.43, reward_accuracy 0.8, val_loss_start 0.693, val_loss 0.019

Usage

pip install mlx-lm
mlx_lm.generate --model "keshavM37/Anvaya-4B" --prompt "Hello"

The system prompt below is built into the chat template, so the model uses it whenever no other system prompt is given.

Recommended sampling

{
  "temperature": 0.7,
  "top_p": 0.95
}

System prompt

Reply with JSON only, shaped like: {"clauses":[{"clause_type":clause_type,"present":bool,"value":str|null,"evidence_span":str|null,"confidence":num|null},...]}
clause_type is one of: governing_law, effective_date, expiration_date, renewal_term, notice_period_to_terminate_renewal, termination_for_convenience, cap_on_liability, uncapped_liability, indemnification, insurance, most_favored_nation, exclusivity, non_compete, ip_ownership_assignment, license_grant, assignment, change_of_control, confidentiality, audit_rights, warranty_duration.
Rules: if present == false then evidence_span == null and value == null; if present == true then evidence_span is a verbatim substring of input; clause_type values are unique within clauses[].

Licence & attribution

This model is a fine-tune of mlx-community/Qwen3-4B-Instruct-2507-4bit and is subject to its licence: Apache-2.0 (https://www.apache.org/licenses/LICENSE-2.0).

What it asks of you: Keep the licence and any NOTICE file with the model, and say you changed it.

200 training examples were written or reviewed by an OpenAI model. OpenAI's terms apply to how those outputs may be used.

See LICENSE-BASE-MODEL.md, and the base model's own licence files where they could be included, in this folder.

Intended use & limitations

A small model fine-tuned for one narrow task on a few thousand examples. It makes mistakes, including confident ones. Check its outputs, and do not use it on its own for medical, legal, financial or safety-critical decisions.

Downloads last month
60
Safetensors
Model size
4B params
Tensor type
U32
ยท
BF16
ยท
MLX
Hardware compatibility
Log In to add your hardware

4-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for M37labsorg/Anvaya-4B