Run this model with HF Jobs
Run tiny-random/falcon-mamba 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 and TRL to fine-tune https://huggingface.co/tiny-random/falcon-mamba. 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/tiny-random/falcon-mamba 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/tiny-random/falcon-mamba. 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/tiny-random/falcon-mamba. 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.
Instructions to use tiny-random/falcon-mamba with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tiny-random/falcon-mamba with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tiny-random/falcon-mamba")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("tiny-random/falcon-mamba") model = AutoModelForCausalLM.from_pretrained("tiny-random/falcon-mamba", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use tiny-random/falcon-mamba with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tiny-random/falcon-mamba" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tiny-random/falcon-mamba", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/tiny-random/falcon-mamba
- SGLang
How to use tiny-random/falcon-mamba 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/falcon-mamba" \ --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": "tiny-random/falcon-mamba", "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 "tiny-random/falcon-mamba" \ --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": "tiny-random/falcon-mamba", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use tiny-random/falcon-mamba with Docker Model Runner:
docker model run hf.co/tiny-random/falcon-mamba
Upload folder using huggingface_hub
Browse filesFiles changed (10)
- .meta/create_model.pyAdded+50
- .meta/env.jsonAdded+33
- .meta/model.logAdded+23
- README.mdAdded+79
- config.jsonAdded+34
- generation_config.jsonAdded+7
- model.safetensorsAdded+3
- special_tokens_map.jsonAdded+22
- tokenizer.jsonAdded
- tokenizer_config.jsonAdded+120
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950def create_model(source_model_id: str, source_revision: str, save_folder: str) -> str: import json from pathlib import Path
import torch from huggingface_hub import hf_hub_download from transformers import AutoConfig, AutoModelForCausalLM, set_seed
folder = Path(save_folder) folder.mkdir(parents=True, exist_ok=True) for name in ( "special_tokens_map.json", "tokenizer.json", "tokenizer_config.json", "generation_config.json", ): (folder / name).write_bytes(Path(hf_hub_download(source_model_id, name, revision=source_revision)).read_bytes())
config = json.loads(Path(hf_hub_download(source_model_id, "config.json", revision=source_revision)).read_text()) # The source ships expand=16 alongside an explicit intermediate width of # 2*hidden; Transformers uses the explicit intermediate_size. SSM state 16, # conv kernel 4 and residuals in FP32 are preserved. config.update( hidden_size=64, intermediate_size=128, num_hidden_layers=4, state_size=16, conv_kernel=4, expand=16, time_step_rank=4, tie_word_embeddings=False, ) (folder / "config.json").write_text(json.dumps(config, indent=2) + "\n")
set_seed(42) model = AutoModelForCausalLM.from_config(AutoConfig.from_pretrained(folder), dtype=torch.bfloat16) model.save_pretrained(folder) (folder / "config.json").write_text(json.dumps(config, indent=2) + "\n") (folder / "generation_config.json").write_bytes( Path(hf_hub_download(source_model_id, "generation_config.json", revision=source_revision)).read_bytes() ) return str(model)
if __name__ == "__main__": create_model( source_model_id="tiiuae/falcon-mamba-7b", source_revision="080ad94b3619e2c2d0afa59bafdc6113465b7006", save_folder="/tmp/falcon-mamba", )123456789101112131415161718192021222324252627282930313233{ "source_model": { "name": "tiiuae/falcon-mamba-7b", "commit_id": "080ad94b3619e2c2d0afa59bafdc6113465b7006" }, "environments": { "creation": { "python": "3.12.13", "packages": { "huggingface_hub": "2.3.0", "safetensors": "0.8.0", "tokenizers": "0.23.3", "torch": "2.13.0+cu126", "transformers": "5.22.0.dev0" }, "cuda": "12.6" }, "transformers": { "python": "3.12.13", "packages": { "huggingface_hub": "2.3.0", "safetensors": "0.8.0", "tokenizers": "0.23.3", "torch": "2.13.0+cu126", "transformers": "5.22.0.dev0" }, "cuda": "12.6", "hardware": { "gpu_model": "NVIDIA H20" } } }}1234567891011121314151617181920212223FalconMambaForCausalLM( (backbone): FalconMambaModel( (embeddings): Embedding(65024, 64) (layers): ModuleList( (0-3): 4 x FalconMambaBlock( (norm): FalconMambaRMSNorm((64,), eps=1e-05) (mixer): FalconMambaMixer( (conv1d): Conv1d(128, 128, kernel_size=(4,), stride=(1,), padding=(3,), groups=128) (act): SiLUActivation() (in_proj): Linear(in_features=64, out_features=256, bias=False) (x_proj): Linear(in_features=128, out_features=36, bias=False) (dt_proj): Linear(in_features=4, out_features=128, bias=True) (out_proj): Linear(in_features=128, out_features=64, bias=False) (dt_layernorm): FalconMambaWeightlessRMSNorm(eps=1e-06) (b_layernorm): FalconMambaWeightlessRMSNorm(eps=1e-06) (c_layernorm): FalconMambaWeightlessRMSNorm(eps=1e-06) ) ) ) (norm_f): FalconMambaRMSNorm((64,), eps=1e-05) ) (lm_head): Linear(in_features=64, out_features=65024, bias=False))12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879---library_name: transformerspipeline_tag: text-generationbase_model:- tiiuae/falcon-mamba-7b---
This is a randomly initialized tiny model based on [tiiuae/falcon-mamba-7b](https://huggingface.co/tiiuae/falcon-mamba-7b) for testing and debugging.
| Feature | Source | This repo ||---|---|---|| Checkpoint tensor elements | 7.27B BF16 | 8.45M BF16 || Safetensors weight files | 14.55 GB (3 files) | 16.91 MB (model.safetensors) || Layers | 64 | 4 || Hidden width / explicit inner width | 4,096 / 8,192 (2x) | 64 / 128 (2x) || SSM state size / conv kernel | 16 / 4 | Same || Time-step rank | 256 | 4 || Vocabulary rows / embedding tying | 65,024 / untied | Same || Stored precision | BF16, residuals FP32 | Same |
SGLang 0.5.10 registers no native implementation for `FalconMambaForCausalLM` (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 | 16.9MB |
### Example usage
#### Transformers (✅ verified)
```pythondef run_transformers(model_id: str): # Force Transformers' built-in reference scan/conv kernels: the tiny # inner widths trip the external causal_conv1d alignment checks. Block the # packages before importing transformers (its kernel fallback decorator # probes them through importlib at import time). import importlib.abc import sys
class _BlockSSM(importlib.abc.MetaPathFinder): def find_spec(self, fullname, path=None, target=None): if fullname == "mamba_ssm" or fullname.startswith("mamba_ssm.") or fullname.startswith("causal_conv1d"): raise ModuleNotFoundError(f"blocked {fullname} for reference kernels") return None
sys.meta_path.insert(0, _BlockSSM()) sys.modules.pop("mamba_ssm", None) sys.modules.pop("causal_conv1d", None)
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="eager").eval().cuda() ) inputs = tokenizer("The quick brown fox jumps over the lazy dog.", 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/falcon-mamba")```
### Creating this repo
- Code: [.meta/create_model.py](.meta/create_model.py)- Model structure: [.meta/model.log](.meta/model.log)- Environment: [.meta/env.json](.meta/env.json)
### Change log
- 2026-11-07: Initial version rebuilt from the official tiiuae/falcon-mamba-7b source with four selective-state-space layers.
*This repo is generated by GPT-6.1-Sol.*12345678910111213141516171819202122232425262728293031323334{ "_name_or_path": "./", "architectures": [ "FalconMambaForCausalLM" ], "bos_token_id": 0, "conv_kernel": 4, "eos_token_id": 11, "expand": 16, "hidden_act": "silu", "hidden_size": 64, "initializer_range": 0.1, "intermediate_size": 128, "layer_norm_epsilon": 1e-05, "model_type": "falcon_mamba", "num_hidden_layers": 4, "pad_token_id": 11, "rescale_prenorm_residual": false, "residual_in_fp32": true, "state_size": 16, "tie_word_embeddings": false, "time_step_floor": 0.0001, "time_step_init_scheme": "random", "time_step_max": 0.1, "time_step_min": 0.001, "time_step_rank": 4, "time_step_scale": 1.0, "torch_dtype": "bfloat16", "transformers_version": "4.43.0.dev0", "use_bias": false, "use_cache": true, "use_conv_bias": true, "vocab_size": 65024}1234567{ "_from_model_config": true, "bos_token_id": 0, "eos_token_id": 11, "pad_token_id": 11, "transformers_version": "4.43.0.dev0"}123version https://git-lfs.github.com/spec/v1oid sha256:ebfd6f94133b1c33379961f36bc762d2eac48763655106e27f3a9b276e6ab0b4size 1691233612345678910111213141516171819202122{ "additional_special_tokens": [ ">>TITLE<<", ">>ABSTRACT<<", ">>INTRODUCTION<<", ">>SUMMARY<<", ">>COMMENT<<", ">>ANSWER<<", ">>QUESTION<<", ">>DOMAIN<<", ">>PREFIX<<", ">>SUFFIX<<", ">>MIDDLE<<" ], "eos_token": { "content": "<|endoftext|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false }}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120{ "add_prefix_space": false, "padding_side": "left", "model_input_names": ["input_ids", "attention_mask"], "added_tokens_decoder": { "0": { "content": ">>TITLE<<", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "1": { "content": ">>ABSTRACT<<", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "2": { "content": ">>INTRODUCTION<<", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "3": { "content": ">>SUMMARY<<", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "4": { "content": ">>COMMENT<<", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "5": { "content": ">>ANSWER<<", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "6": { "content": ">>QUESTION<<", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "7": { "content": ">>DOMAIN<<", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "8": { "content": ">>PREFIX<<", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "9": { "content": ">>SUFFIX<<", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "10": { "content": ">>MIDDLE<<", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "11": { "content": "<|endoftext|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true } }, "additional_special_tokens": [ ">>TITLE<<", ">>ABSTRACT<<", ">>INTRODUCTION<<", ">>SUMMARY<<", ">>COMMENT<<", ">>ANSWER<<", ">>QUESTION<<", ">>DOMAIN<<", ">>PREFIX<<", ">>SUFFIX<<", ">>MIDDLE<<" ], "clean_up_tokenization_spaces": true, "eos_token": "<|endoftext|>", "model_max_length": 1000000000000000019884624838656, "tokenizer_class": "PreTrainedTokenizerFast"}.meta/create_model.pyAdded+50
.meta/env.jsonAdded+33
.meta/model.logAdded+23
README.mdAdded+79
config.jsonAdded+34
generation_config.jsonAdded+7
model.safetensorsAdded+3
special_tokens_map.jsonAdded+22
tokenizer.jsonAdded
tokenizer_config.jsonAdded+120