Instructions to use kai-os/Carnice-V2-27b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use kai-os/Carnice-V2-27b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="kai-os/Carnice-V2-27b") 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("kai-os/Carnice-V2-27b") model = AutoModelForMultimodalLM.from_pretrained("kai-os/Carnice-V2-27b", 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 kai-os/Carnice-V2-27b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "kai-os/Carnice-V2-27b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kai-os/Carnice-V2-27b", "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/kai-os/Carnice-V2-27b
- SGLang
How to use kai-os/Carnice-V2-27b 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 "kai-os/Carnice-V2-27b" \ --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": "kai-os/Carnice-V2-27b", "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 "kai-os/Carnice-V2-27b" \ --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": "kai-os/Carnice-V2-27b", "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 kai-os/Carnice-V2-27b with Docker Model Runner:
docker model run hf.co/kai-os/Carnice-V2-27b
missing files and vllm deploying failed!
missing files: merges.txt preprocessor_config.json video_preprocessor_config.json vocab.json
I copied them from Qwen/Qwen3.6-27B
And still fail:
ValueError: Following weights were not initialized from checkpoint: {'model.layers.0.self_attn.o_proj.weight', 'model.pre_fc_norm_hidden.weight', 'model.fc.weight', 'model.layers.0.self_attn.k_norm.weight', 'model.layers.0.self_attn.qkv_proj.weight', 'model.norm.weight', 'model.layers.0.self_attn.q_norm.weight', 'model.layers.0.input_layernorm.weight', 'model.layers.0.mlp.down_proj.weight', 'model.layers.0.post_attention_layernorm.weight', 'model.pre_fc_norm_embedding.weight', 'model.layers.0.mlp.gate_up_proj.weight'}
把Qwen/Qwen3.6-27B的文件copy过来能用,用sglang部署成功了
把Qwen/Qwen3.6-27B的文件copy过来能用,用sglang部署成功了
还能识别图片吗?
另外sglang部署的Qwen/Qwen3.6-27B,在claude code中使用存在问题,老是返回空的content
把Qwen/Qwen3.6-27B的文件copy过来能用,用sglang部署成功了
还能识别图片吗?
另外sglang部署的Qwen/Qwen3.6-27B,在claude code中使用存在问题,老是返回空的content
把preprocessor_config.json文件copy过来,使用镜像lmsysorg-sglang:v0.5.10-cu130,然后使用以下参数部署,目前为止使用正常:
SGLANG_CACHE_DIR=/cached-root/cache/carnice-v2-27b-l20/sglang-cached SGLANG_DG_CACHE_DIR=/cached-root/cache/carnice-v2-27b-l20/deep_gemm TRITON_CACHE_DIR=/cached-root/cache/carnice-v2-27b-l20/triton SGLANG_TORCHINDUCTOR_CACHE_DIR=/cached-root/cache/carnice-v2-27b-l20/torch-inductor SGLANG_ENABLE_SPEC_V2=1 SGLANG_ENABLE_CUSTOM_ALL_REDUCE=0 sglang serve --model-path /models/kai-os/Carnice-V2-27b --trust-remote-code --host 0.0.0.0 --port 8000 --tp-size 2 --mem-fraction-static 0.94 --max-running-requests 8 --context-length 262144 --reasoning-parser qwen3 --tool-call-parser qwen3_coder --enable-metrics --enable-cache-report --cuda-graph-max-bs 16