Text Generation
Transformers
Safetensors
PyTorch
English
laneformer
causal-lm
delayed-tensor-parallelism
dtp
conversational
custom_code
Eval Results
Instructions to use kogai/laneformer-2b-it with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use kogai/laneformer-2b-it with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="kogai/laneformer-2b-it", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("kogai/laneformer-2b-it", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use kogai/laneformer-2b-it with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "kogai/laneformer-2b-it" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kogai/laneformer-2b-it", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/kogai/laneformer-2b-it
- SGLang
How to use kogai/laneformer-2b-it 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 "kogai/laneformer-2b-it" \ --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": "kogai/laneformer-2b-it", "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 "kogai/laneformer-2b-it" \ --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": "kogai/laneformer-2b-it", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use kogai/laneformer-2b-it with Docker Model Runner:
docker model run hf.co/kogai/laneformer-2b-it
Download config.json from kogai/laneformer-2b-it: direct link, hf CLI and curl.
- Browser
- Download file 1.47 kB
-
https://huggingface.co/kogai/laneformer-2b-it/resolve/main/config.json
- Command line
-
hf download hf://kogai/laneformer-2b-it/config.json
-
curl -L -o config.json https://huggingface.co/kogai/laneformer-2b-it/resolve/main/config.json
1.47 kB
| { | |
| "model_type": "laneformer", | |
| "architectures": [ | |
| "LaneformerForCausalLM" | |
| ], | |
| "auto_map": { | |
| "AutoConfig": "configuration_laneformer.LaneformerConfig", | |
| "AutoModel": "modeling_laneformer.LaneformerModel", | |
| "AutoModelForCausalLM": "modeling_laneformer.LaneformerForCausalLM" | |
| }, | |
| "hidden_size": 3072, | |
| "num_hidden_layers": 15, | |
| "num_attention_heads": 32, | |
| "num_key_value_heads": 16, | |
| "intermediate_size": 12288, | |
| "max_position_embeddings": 4096, | |
| "max_seq_len": 4096, | |
| "eos_token_id": 2, | |
| "pad_token_id": 2, | |
| "vocab_size": 32000, | |
| "rope_theta": 10000, | |
| "norm_eps": 1e-05, | |
| "use_cache": false, | |
| "num_lanes": 8, | |
| "broadcast_delay": 2, | |
| "use_attention_comm": true, | |
| "use_mlp_comm": true, | |
| "use_early_comm": false, | |
| "lm_head_type": "vocab_parallel", | |
| "pre_norm_lane_agg": false, | |
| "replicated_rmsn_scale": true, | |
| "tie_word_embeddings": false, | |
| "sliding_window": 2048, | |
| "swa_layers": [ | |
| 0, | |
| 1, | |
| 2, | |
| 3, | |
| 4, | |
| 5, | |
| 6, | |
| 7, | |
| 8, | |
| 9 | |
| ], | |
| "layer_types": [ | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention" | |
| ], | |
| "_attn_implementation": "sdpa", | |
| "dtype": "bfloat16", | |
| "transformers_version": "4.57.6" | |
| } | |