Instructions to use tiny-random/jamba with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tiny-random/jamba with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tiny-random/jamba") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("tiny-random/jamba") model = AutoModelForCausalLM.from_pretrained("tiny-random/jamba", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use tiny-random/jamba with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tiny-random/jamba" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tiny-random/jamba", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/tiny-random/jamba
- SGLang
How to use tiny-random/jamba 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 "tiny-random/jamba" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tiny-random/jamba", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "tiny-random/jamba" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tiny-random/jamba", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use tiny-random/jamba with Docker Model Runner:
docker model run hf.co/tiny-random/jamba
This is a randomly initialized tiny model based on ai21labs/AI21-Jamba-1.5-Large for testing and debugging.
| Feature | Source | This repo |
|---|---|---|
| Checkpoint tensor elements | 398.56B BF16 | 12.31M BF16 |
| Safetensors weight files | 797.11 GB (166 files) | 24.69 MB (model.safetensors) |
| Layers / layer cycle | 72 / 8-layer cycle | 16 / two complete cycles |
| Cycle composition | 4 MoE + 1 attention + 3 SSM | Same |
| Residual width / expert FFN width | 8,192 / 24,576 | 64 / 128 |
| Q heads / KV heads / head_dim | 64 / 8 / 128 | 4 / 4 / 32 |
| Experts / top-k | 16 / 2 | Same |
| Mamba state / expand / dt rank | 16 / 2 / 512 | 16 / 2 / 16 |
| Vocabulary rows / embedding tying | 65,536 / untied | Same |
| Stored precision | BF16 | Same |
The SSM sublayers run through the automatic kernel selection: the optimized mamba_ssm / causal-conv1d kernels when installed, otherwise the built-in PyTorch scan implementation.
SGLang 0.5.10 registers no native implementation for JambaForCausalLM (no EntryClass in sglang/srt/models), so only the generic TransformersForCausalLM fallback exists, which does not shard the model across tensor-parallel ranks. Serving evidence for this repository is the Transformers example.
| File path | Size |
|---|---|
| model.safetensors | 24.7MB |
Example usage
Transformers (โ verified)
def run_transformers(model_id: str):
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = str(model_id)
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = (
AutoModelForCausalLM.from_pretrained(model_id, dtype=torch.bfloat16, attn_implementation="sdpa").eval().cuda()
)
prompt = tokenizer.apply_chat_template(
[{"role": "user", "content": "Tell me a joke."}],
tokenize=False,
add_generation_prompt=True,
)
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
with torch.no_grad():
assert torch.isfinite(model(**inputs).logits).all()
output = model.generate(**inputs, do_sample=False, max_new_tokens=8)
print(tokenizer.decode(output[0], skip_special_tokens=True))
if __name__ == "__main__":
run_transformers(model_id="tiny-random/jamba")
Creating this repo
- Code: .meta/create_model.py
- Model structure: .meta/model.log
- Environment: .meta/env.json
Change log
- 2026-11-07: Initial version rebuilt from the official ai21labs/AI21-Jamba-1.5-Large source with two complete 8-layer attention/SSM/MoE cycles.
This repo is generated by GPT-6.1-Sol.
- Downloads last month
- -
Model tree for tiny-random/jamba
Base model
ai21labs/AI21-Jamba-Large-1.5