Image-Text-to-Text
Transformers
Safetensors
English
inkling_mm_model
conversational
audio-text-to-text
Mixture of Experts
compressed-tensors
Instructions to use cyankiwi/Inkling-Small-AWQ-INT4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cyankiwi/Inkling-Small-AWQ-INT4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="cyankiwi/Inkling-Small-AWQ-INT4") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("cyankiwi/Inkling-Small-AWQ-INT4") model = AutoModelForMultimodalLM.from_pretrained("cyankiwi/Inkling-Small-AWQ-INT4", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use cyankiwi/Inkling-Small-AWQ-INT4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cyankiwi/Inkling-Small-AWQ-INT4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cyankiwi/Inkling-Small-AWQ-INT4", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/cyankiwi/Inkling-Small-AWQ-INT4
- SGLang
How to use cyankiwi/Inkling-Small-AWQ-INT4 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 "cyankiwi/Inkling-Small-AWQ-INT4" \ --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": "cyankiwi/Inkling-Small-AWQ-INT4", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "cyankiwi/Inkling-Small-AWQ-INT4" \ --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": "cyankiwi/Inkling-Small-AWQ-INT4", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use cyankiwi/Inkling-Small-AWQ-INT4 with Docker Model Runner:
docker model run hf.co/cyankiwi/Inkling-Small-AWQ-INT4
Run on 8x3090 (or other Ampere)
#1
by avtc - opened
Good quant, thanks!
Here is a branch that adds support of Ampere cards (3090 etc).
# switch the editable install onto the mixed-precision branch
git remote add avtc https://github.com/avtc/vllm.git
git fetch avtc feature/inkling-w4a16-mixed-precision-ampere
git checkout feature/inkling-w4a16-mixed-precision-ampere
example start command:
export TORCH_CUDA_ARCH_LIST="8.6"
export CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7
export RAY_memory_monitor_refresh_ms=0
export NCCL_CUMEM_ENABLE=0
export VLLM_ENABLE_CUDAGRAPH_GC=1
export VLLM_MEMORY_PROFILER_ESTIMATE_CUDAGRAPHS=0
export VLLM_ALLOW_LONG_MAX_MODEL_LEN=1
export VLLM_MARLIN_USE_ATOMIC_ADD=1
export VLLM_FLOAT32_MATMUL_PRECISION=high
export OMP_NUM_THREADS=1
vllm serve /home/ubuntu/models/Inkling-Small-AWQ-INT4-cyankiwi \
-tp 8 \
-dp 1 \
--served-model-name ink-small \
--port 8000 \
--host 0.0.0.0 \
--uvicorn-log-level info \
--trust-remote-code \
--gpu-memory-utilization 0.87 \
--seed 1234 \
--enable-sleep-mode \
--skip-mm-profiling \
-O3 \
--no-use-tqdm-on-load \
--tokenizer-mode inkling \
--tool-call-parser inkling \
--reasoning-parser inkling \
--enable-auto-tool-choice \
--performance-mode balanced \
--enable-chunked-prefill \
--max-num-seqs 4 \
--max-model-len auto \
--default-chat-template-kwargs '{"interleaved_thinking": true, "preserve_thinking": true}' \
--kernel-config.enable_flashinfer_autotune=False \
--enable-prefix-caching \
--max-num-batched-tokens 2048
Notes:
fp16 kv-cache gives 414912 context size, vram usage 23.85GB per card. (lower --gpu-memory-utilization in case of cuda oom in the process)
fp8 or KVarN are not supported.