Instructions to use CraneAILabs/crane-nemotron-nano-4b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use CraneAILabs/crane-nemotron-nano-4b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="CraneAILabs/crane-nemotron-nano-4b", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("CraneAILabs/crane-nemotron-nano-4b", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("CraneAILabs/crane-nemotron-nano-4b", trust_remote_code=True, 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use CraneAILabs/crane-nemotron-nano-4b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "CraneAILabs/crane-nemotron-nano-4b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CraneAILabs/crane-nemotron-nano-4b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/CraneAILabs/crane-nemotron-nano-4b
- SGLang
How to use CraneAILabs/crane-nemotron-nano-4b 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 "CraneAILabs/crane-nemotron-nano-4b" \ --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": "CraneAILabs/crane-nemotron-nano-4b", "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 "CraneAILabs/crane-nemotron-nano-4b" \ --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": "CraneAILabs/crane-nemotron-nano-4b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use CraneAILabs/crane-nemotron-nano-4b with Docker Model Runner:
docker model run hf.co/CraneAILabs/crane-nemotron-nano-4b
Crane Nemotron 4B
An experimental hybrid-architecture model for East African languages and agentic tool-calling.
Crane Nemotron 4B is a research model from Crane AI Labs exploring hybrid Mamba + Transformer architectures for multilingual and agentic use. Most open language models are pure Transformers. This one is not: it is built on NVIDIA's Nemotron-Nano (NemotronH) backbone, which interleaves Mamba-2 state-space layers with attention layers. We were curious how well a hybrid SSM/attention model absorbs low-resource languages and structured tool use, so we adapted it to seven East African languages, taught it agentic tool-calling, and used reinforcement learning to correct multilingual drift and tool-triggering.
This is an experiment, shared in that spirit. The numbers and behavior below are what we measured, including where the model still falls short.
Highlights
- Hybrid architecture (Mamba-2 state-space + attention), not a pure Transformer.
- 7 East African languages: Amharic, English, Hausa, Kinyarwanda, Luganda, Somali, Swahili.
- Agentic tool-calling: web search, weather, and calculator, with a 90% tool-trigger decision accuracy.
- Large reasoning and knowledge gains over the base checkpoint after continued pretraining, unified SFT, and RL.
Strengths (measured)
| Benchmark | Base | Crane Nemotron 4B |
|---|---|---|
| MMLU (knowledge) | 29.8 | 53.8 |
| GSM8K (math reasoning) | 60.4 | 75.2 |
| Tool-trigger accuracy (80 cases) | ~52 (SFT) | 90 |
| Language-consistency reward (RL) | 0.73 | 0.90 |
| FLORES X to English chrF | Swahili 49 / Luganda 36 |
- Coherent multilingual chat and persona across the seven languages.
- Tool over-calling eliminated; tool under-calling reduced to 6/40 on the balanced eval.
- Translation into English is strong for the higher-resource languages (Swahili, Luganda).
Limitations
We prefer to be direct about what does not work yet.
- AfriMMLU is near chance (~23%): multilingual knowledge QA remains weak.
- English-to-X generation is weaker than X-to-English.
- Amharic generation (Ge'ez script) is currently unreliable.
- Calculator tool still occasionally narrates ("let me use the calculator...") instead of emitting the call on harder expressions (residual ~6/40 under-call).
- This is a research checkpoint, not a production-hardened model.
Architecture and training
- Base: NVIDIA Nemotron-Nano 4B (NemotronH), a hybrid Mamba-2 + Transformer model.
- Pipeline: continued pretraining on East African language data, unified capability SFT (chat + persona + tool-calling in one pass so nothing washes out), then GRPO reinforcement learning for language consistency and tool-triggering.
- Tool-calling uses the
qwen3_xmltool-call format and supports OpenAI-styletoolswithtool_choice="auto".
Intended use
Research and experimentation with hybrid architectures for African-language and agentic applications. Not intended for high-stakes or unsupervised production use.
Acknowledgements
Built on NVIDIA Nemotron-Nano. Developed by Crane AI Labs as part of ongoing work on East African language models and hybrid architectures.
- Downloads last month
- 284