Text Generation
Transformers
Safetensors
huginn_raven
depth-recurrent
latent-reasoning
huginn
raven
test-time-compute
recurrent-depth
custom_code
Instructions to use irafm-llm/Recurrent-Llama-3.2-1B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use irafm-llm/Recurrent-Llama-3.2-1B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="irafm-llm/Recurrent-Llama-3.2-1B", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("irafm-llm/Recurrent-Llama-3.2-1B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use irafm-llm/Recurrent-Llama-3.2-1B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "irafm-llm/Recurrent-Llama-3.2-1B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "irafm-llm/Recurrent-Llama-3.2-1B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/irafm-llm/Recurrent-Llama-3.2-1B
- SGLang
How to use irafm-llm/Recurrent-Llama-3.2-1B 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 "irafm-llm/Recurrent-Llama-3.2-1B" \ --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": "irafm-llm/Recurrent-Llama-3.2-1B", "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 "irafm-llm/Recurrent-Llama-3.2-1B" \ --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": "irafm-llm/Recurrent-Llama-3.2-1B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use irafm-llm/Recurrent-Llama-3.2-1B with Docker Model Runner:
docker model run hf.co/irafm-llm/Recurrent-Llama-3.2-1B
Recurrent-Llama-3.2-1B: surgery from Llama-3.2-1B + healing (FineWeb-Edu, ~98M tok)
eefd08c verified Download config.json from irafm-llm/Recurrent-Llama-3.2-1B: direct link, hf CLI and curl.
- Browser
- Download file 1.92 kB
-
https://huggingface.co/irafm-llm/Recurrent-Llama-3.2-1B/resolve/main/config.json
- Command line
-
hf download hf://irafm-llm/Recurrent-Llama-3.2-1B/config.json
-
curl -L -o config.json https://huggingface.co/irafm-llm/Recurrent-Llama-3.2-1B/resolve/main/config.json
1.92 kB
| { | |
| "activation_checkpoint_impl": "per-iteration", | |
| "architecture_class_name": "RecurrentGPT", | |
| "architectures": [ | |
| "RavenForCausalLM" | |
| ], | |
| "attn_impl": "sdpa", | |
| "attn_logit_softcapping": null, | |
| "auto_map": { | |
| "AutoConfig": "raven_config_minimal.RavenConfig", | |
| "AutoModelForCausalLM": "raven_modeling_minimal.RavenForCausalLM" | |
| }, | |
| "bias": false, | |
| "block_class_name": "SandwichBlock", | |
| "block_size": 4096, | |
| "block_type": "prenorm", | |
| "compare_mode": false, | |
| "effective_expected_depth": 200, | |
| "final_logit_softcapping": null, | |
| "head_dim": 64, | |
| "init_orthogonal": false, | |
| "init_strategy": "takase", | |
| "init_values": { | |
| "embed_scale": 1.0, | |
| "embedding": 0.013975424859373685, | |
| "out_proj": 0.0006987712429686843, | |
| "std": 0.013975424859373685 | |
| }, | |
| "injection_type": "linear", | |
| "intermediate_size": 8192, | |
| "max_position_embeddings": 131072, | |
| "mean_backprop_depth": 8, | |
| "mean_recurrence": 16, | |
| "mlp_class_name": "GatedMLP", | |
| "model_type": "huginn_raven", | |
| "n_embd": 2048, | |
| "n_heads": 32, | |
| "n_layers": 14, | |
| "n_layers_in_coda": 4, | |
| "n_layers_in_prelude": 4, | |
| "n_layers_in_recurrent_block": 6, | |
| "nonlin_name": "SiLU", | |
| "norm_class_name": "RMSNorm_llama", | |
| "norm_eps": 1e-05, | |
| "norm_type": "llama", | |
| "num_key_value_heads": 8, | |
| "padded_vocab_size": 128256, | |
| "padding_multiple": 4096, | |
| "qk_bias": false, | |
| "query_pre_attn_scalar": null, | |
| "rope_base": 500000.0, | |
| "rope_scaling": { | |
| "factor": 32.0, | |
| "high_freq_factor": 4.0, | |
| "low_freq_factor": 1.0, | |
| "original_max_position_embeddings": 8192, | |
| "rope_type": "llama3" | |
| }, | |
| "rope_theta": 500000.0, | |
| "sampling_scheme": "poisson-lognormal-filling", | |
| "source_arch": "llama", | |
| "state_init": "like-init", | |
| "test_time_noise": 0, | |
| "test_time_noise_type": "fixed", | |
| "tie_embeddings": false, | |
| "tie_word_embeddings": false, | |
| "torch_dtype": "bfloat16", | |
| "transformers_version": "4.51.0", | |
| "vocab_size": 128256 | |
| } | |