Instructions to use khtsly/Kai-2.0-Base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use khtsly/Kai-2.0-Base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="khtsly/Kai-2.0-Base", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("khtsly/Kai-2.0-Base", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use khtsly/Kai-2.0-Base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "khtsly/Kai-2.0-Base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "khtsly/Kai-2.0-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/khtsly/Kai-2.0-Base
- SGLang
How to use khtsly/Kai-2.0-Base 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 "khtsly/Kai-2.0-Base" \ --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": "khtsly/Kai-2.0-Base", "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 "khtsly/Kai-2.0-Base" \ --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": "khtsly/Kai-2.0-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use khtsly/Kai-2.0-Base with Docker Model Runner:
docker model run hf.co/khtsly/Kai-2.0-Base
Download config.json from khtsly/Kai-2.0-Base: direct link, hf CLI and curl.
- Browser
- Download file 1.43 kB
-
https://huggingface.co/khtsly/Kai-2.0-Base/resolve/main/config.json
- Command line
-
hf download hf://khtsly/Kai-2.0-Base/config.json
-
curl -L -o config.json https://huggingface.co/khtsly/Kai-2.0-Base/resolve/main/config.json
1.43 kB
| { | |
| "architectures": [ | |
| "LuauCoderForCausalLM" | |
| ], | |
| "model_type": "luau_coder", | |
| "auto_map": { | |
| "AutoConfig": "configuration_luau_coder.LuauCoderConfig", | |
| "AutoModel": "modeling_luau_coder.LuauCoderModel", | |
| "AutoModelForCausalLM": "modeling_luau_coder.LuauCoderForCausalLM" | |
| }, | |
| "vocab_size": 32768, | |
| "hidden_size": 1408, | |
| "intermediate_size": 3840, | |
| "num_hidden_layers": 28, | |
| "num_attention_heads": 10, | |
| "num_key_value_heads": 2, | |
| "head_dim": 128, | |
| "rms_norm_eps": 1e-06, | |
| "final_logit_softcapping": 30.0, | |
| "max_position_embeddings": 16384, | |
| "rope_theta": 500000.0, | |
| "rope_scaling": { | |
| "rope_type": "yarn", | |
| "factor": 4.0, | |
| "original_max_position_embeddings": 4096, | |
| "beta_fast": 32.0, | |
| "beta_slow": 1.0, | |
| "truncate": true | |
| }, | |
| "nope_layers": [ | |
| 3, | |
| 7, | |
| 11, | |
| 15, | |
| 19, | |
| 23, | |
| 27 | |
| ], | |
| "diff_v2": true, | |
| "xsa": true, | |
| "qk_norm": true, | |
| "use_output_gate": null, | |
| "attn_res": true, | |
| "attn_res_block_size": 4, | |
| "attn_res_delta_block": false, | |
| "attn_res_partial_source": false, | |
| "msar": false, | |
| "ccgqa": true, | |
| "ccgqa_seq_kernel": 2, | |
| "ccgqa_head_kernel": 2, | |
| "ccgqa_qk_mean": true, | |
| "ccgqa_value_shift": true, | |
| "vha": true, | |
| "iha": false, | |
| "iha_pseudo_heads": 2, | |
| "iha_window": 0, | |
| "iha_global_every": 5, | |
| "initializer_range": 0.026650089544451305, | |
| "tie_word_embeddings": true, | |
| "lerope_alpha": null, | |
| "bos_token_id": null, | |
| "eos_token_id": 32744, | |
| "pad_token_id": 32745, | |
| "torch_dtype": "bfloat16", | |
| "name": "kai" | |
| } |