Text Generation
Transformers
Safetensors
English
llama
legal
finance
small-language-model
text-generation-inference
Instructions to use sumitguha13/slm125MLIVE-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sumitguha13/slm125MLIVE-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="sumitguha13/slm125MLIVE-base")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("sumitguha13/slm125MLIVE-base") model = AutoModelForCausalLM.from_pretrained("sumitguha13/slm125MLIVE-base") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use sumitguha13/slm125MLIVE-base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sumitguha13/slm125MLIVE-base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sumitguha13/slm125MLIVE-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/sumitguha13/slm125MLIVE-base
- SGLang
How to use sumitguha13/slm125MLIVE-base with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "sumitguha13/slm125MLIVE-base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sumitguha13/slm125MLIVE-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "sumitguha13/slm125MLIVE-base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sumitguha13/slm125MLIVE-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use sumitguha13/slm125MLIVE-base with Docker Model Runner:
docker model run hf.co/sumitguha13/slm125MLIVE-base
slm125MLIVE-base
A 125M-parameter LLaMA-architecture small language model pretrained from scratch on a legal + financial corpus. Base model (no instruction tuning).
Model
- Architecture: LLaMA (transformers
LlamaForCausalLM), 12 layers / 768 hidden / 12 heads (MHA), SwiGLU, RoPE, RMSNorm, tied embeddings. - Params: ~125.8M. Context length: 1024. Vocab: 16,384 (byte-level BPE trained on this corpus).
Training data (~2.04B tokens, 1 epoch)
Legal-first mix, cleaned / deduplicated / decontaminated:
HFforLegal/case-law(US court opinions) โ ~40%PleIAs/SEC(SEC filings) โ ~40%HuggingFaceFW/fineweb-edu(educational web) โ ~20%
Decontaminated against CaseHOLD / LexGLUE (13-gram overlap removal).
Results
- Validation perplexity: 10.44 (full held-out set, 20.56M tokens).
- Final val loss: 2.346. Trained 3,889 steps at a 524,288-token global batch.
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
tok = AutoTokenizer.from_pretrained("sumitguha13/slm125MLIVE-base")
model = AutoModelForCausalLM.from_pretrained("sumitguha13/slm125MLIVE-base")
ids = tok("<|bos|>The plaintiff shall bear the burden of", return_tensors="pt").input_ids
print(tok.decode(model.generate(ids, max_new_tokens=60)[0], skip_special_tokens=True))
Limitations
Base model: generates fluent, domain-appropriate text but invents facts and does not follow instructions. Not for production or legal/financial advice.
- Downloads last month
- 296