Text Generation
Transformers
Safetensors
English
kimi_linear
kimi-k3
luau
experimental-checkpoint
custom_code
Instructions to use khtsly/d with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use khtsly/d with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="khtsly/d", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("khtsly/d", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("khtsly/d", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use khtsly/d with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "khtsly/d" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "khtsly/d", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/khtsly/d
- SGLang
How to use khtsly/d 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/d" \ --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/d", "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/d" \ --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/d", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use khtsly/d with Docker Model Runner:
docker model run hf.co/khtsly/d
Download config.json from khtsly/d: direct link, hf CLI and curl.
- Browser
- Download file 1.66 kB
-
https://huggingface.co/khtsly/d/resolve/main/config.json
- Command line
-
hf download hf://khtsly/d/config.json
-
curl -L -o config.json https://huggingface.co/khtsly/d/resolve/main/config.json
1.66 kB
| { | |
| "architectures": [ | |
| "KimiLinearForCausalLM" | |
| ], | |
| "model_type": "kimi_linear", | |
| "auto_map": { | |
| "AutoConfig": "configuration_kimi_k3.KimiLinearConfig", | |
| "AutoModelForCausalLM": "modeling_kimi_linear.KimiLinearForCausalLM" | |
| }, | |
| "vocab_size": 32768, | |
| "hidden_size": 2560, | |
| "num_hidden_layers": 32, | |
| "num_attention_heads": 20, | |
| "num_key_value_heads": 20, | |
| "max_position_embeddings": 1048576, | |
| "rms_norm_eps": 1e-06, | |
| "tie_word_embeddings": true, | |
| "linear_attn_config": { | |
| "full_attn_layers": [ | |
| 4, | |
| 8, | |
| 12, | |
| 16, | |
| 20, | |
| 24, | |
| 28, | |
| 32 | |
| ], | |
| "kda_layers": [ | |
| 1, | |
| 2, | |
| 3, | |
| 5, | |
| 6, | |
| 7, | |
| 9, | |
| 10, | |
| 11, | |
| 13, | |
| 14, | |
| 15, | |
| 17, | |
| 18, | |
| 19, | |
| 21, | |
| 22, | |
| 23, | |
| 25, | |
| 26, | |
| 27, | |
| 29, | |
| 30, | |
| 31 | |
| ], | |
| "num_heads": 20, | |
| "head_dim": 128, | |
| "short_conv_kernel_size": 4, | |
| "gate_lower_bound": -5.0, | |
| "use_full_rank_gate": true | |
| }, | |
| "q_lora_rank": 1280, | |
| "kv_lora_rank": 640, | |
| "qk_nope_head_dim": 128, | |
| "qk_rope_head_dim": 0, | |
| "v_head_dim": 128, | |
| "mla_use_nope": true, | |
| "mla_use_output_gate": true, | |
| "num_experts": 0, | |
| "num_experts_per_tok": 0, | |
| "num_shared_experts": 0, | |
| "moe_intermediate_size": 0, | |
| "routed_expert_hidden_size": 0, | |
| "first_k_dense_replace": 32, | |
| "routed_scaling_factor": 1.0, | |
| "moe_renormalize": false, | |
| "moe_router_activation_func": "sigmoid", | |
| "dense_ffn_hidden": 6144, | |
| "intermediate_size": 6144, | |
| "hidden_act": "situ", | |
| "activation_situ_beta": 4.0, | |
| "activation_situ_linear_beta": 25.0, | |
| "attn_res_block_size": 4, | |
| "initializer_range": 0.02 | |
| } |