Text Generation
Transformers
Safetensors
llama
causal-lm
legal
finance
modal
text-generation-inference
Instructions to use tirumalaseti/slm-125m-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tirumalaseti/slm-125m-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tirumalaseti/slm-125m-base")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("tirumalaseti/slm-125m-base") model = AutoModelForCausalLM.from_pretrained("tirumalaseti/slm-125m-base", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use tirumalaseti/slm-125m-base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tirumalaseti/slm-125m-base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tirumalaseti/slm-125m-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/tirumalaseti/slm-125m-base
- SGLang
How to use tirumalaseti/slm-125m-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 "tirumalaseti/slm-125m-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": "tirumalaseti/slm-125m-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 "tirumalaseti/slm-125m-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": "tirumalaseti/slm-125m-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use tirumalaseti/slm-125m-base with Docker Model Runner:
docker model run hf.co/tirumalaseti/slm-125m-base
tirumalaseti/slm-125m-base
This is a 125M-parameter base completion model trained from scratch on a legal/financial-heavy corpus. It is not a chatbot: it was optimized for next-token prediction and works best when prompted with the opening of a sentence or paragraph to continue.
Model summary
- Trainable parameters: 125,847,552 (~125.848M)
- Architecture: 12-layer Llama-style decoder, 768 hidden size, 12 attention heads
- Context length: 1,024 tokens
- Tokenizer: 16,384-token byte-level BPE
- Training tokens seen: 2,500,329,472
- Optimizer steps: 4,769
- Completed epochs over the packed train set: 1.23
- Final validation loss: 2.3035
- Final validation perplexity: 10.01
- Reported spend: $0.00
Training corpus
The packed corpus used for pretraining contains 2,059,674,624 total tokens:
- Train: 2,039,072,768
- Validation: 20,601,856
Realized source mix:
- US case law: 722,081,792 tokens (35.1%)
- SEC filings: 868,714,496 tokens (42.2%)
- Educational web text: 468,878,336 tokens (22.8%)
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "tirumalaseti/slm-125m-base"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id)
prompt = "The plaintiff respectfully moves this Court to"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=96, temperature=0.8, top_p=0.95)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Notes
- This is a base model, not an instruction-tuned assistant.
- It is strongest at continuing legal/financial prose in-register.
- The spend figure comes from the latest visible Modal billing report; Modal billing report may lag; this value reflects the latest locally visible report..
- Downloads last month
- 144