Text Generation
Transformers
Safetensors
qwen3
compressed-tensors
kv-cache
quantization
conversational
text-generation-inference
Instructions to use inference-optimization/TinyQwen3-KV-Cache-Only with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use inference-optimization/TinyQwen3-KV-Cache-Only with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="inference-optimization/TinyQwen3-KV-Cache-Only") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("inference-optimization/TinyQwen3-KV-Cache-Only") model = AutoModelForCausalLM.from_pretrained("inference-optimization/TinyQwen3-KV-Cache-Only", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use inference-optimization/TinyQwen3-KV-Cache-Only with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "inference-optimization/TinyQwen3-KV-Cache-Only" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "inference-optimization/TinyQwen3-KV-Cache-Only", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/inference-optimization/TinyQwen3-KV-Cache-Only
- SGLang
How to use inference-optimization/TinyQwen3-KV-Cache-Only 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 "inference-optimization/TinyQwen3-KV-Cache-Only" \ --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": "inference-optimization/TinyQwen3-KV-Cache-Only", "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 "inference-optimization/TinyQwen3-KV-Cache-Only" \ --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": "inference-optimization/TinyQwen3-KV-Cache-Only", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use inference-optimization/TinyQwen3-KV-Cache-Only with Docker Model Runner:
docker model run hf.co/inference-optimization/TinyQwen3-KV-Cache-Only
Download config.json from inference-optimization/TinyQwen3-KV-Cache-Only: direct link, hf CLI and curl.
- Browser
- Download file 1.35 kB
-
https://huggingface.co/inference-optimization/TinyQwen3-KV-Cache-Only/resolve/main/config.json
- Command line
-
hf download hf://inference-optimization/TinyQwen3-KV-Cache-Only/config.json
-
curl -L -o config.json https://huggingface.co/inference-optimization/TinyQwen3-KV-Cache-Only/resolve/main/config.json
1.35 kB
| { | |
| "architectures": [ | |
| "Qwen3ForCausalLM" | |
| ], | |
| "attention_bias": false, | |
| "attention_dropout": 0.0, | |
| "dtype": "float32", | |
| "head_dim": 128, | |
| "hidden_act": "silu", | |
| "hidden_size": 64, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 128, | |
| "layer_types": [ | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention" | |
| ], | |
| "max_position_embeddings": 32768, | |
| "max_window_layers": 28, | |
| "model_type": "qwen3", | |
| "num_attention_heads": 16, | |
| "num_hidden_layers": 6, | |
| "num_key_value_heads": 8, | |
| "quantization_config": { | |
| "config_groups": {}, | |
| "format": "dense", | |
| "global_compression_ratio": null, | |
| "ignore": [], | |
| "kv_cache_scheme": { | |
| "dynamic": false, | |
| "group_size": null, | |
| "num_bits": 8, | |
| "strategy": "tensor", | |
| "symmetric": true, | |
| "type": "float" | |
| }, | |
| "moe_sparsity_config": null, | |
| "quant_method": "compressed-tensors", | |
| "quantization_status": "compressed", | |
| "sparsity_config": {}, | |
| "transform_config": {}, | |
| "version": "0.19.1.dev22+g3cb3ca29.d20261014" | |
| }, | |
| "rms_norm_eps": 1e-06, | |
| "rope_scaling": null, | |
| "rope_theta": 10000.0, | |
| "sliding_window": null, | |
| "tie_word_embeddings": false, | |
| "transformers_version": "4.57.6", | |
| "use_cache": true, | |
| "use_sliding_window": false, | |
| "vocab_size": 1050 | |
| } |