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
File size: 1,657 Bytes
b136c45 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | {
"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
} |