Instructions to use Skywork/Skywork-R1V2-38B-AWQ with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Skywork/Skywork-R1V2-38B-AWQ with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Skywork/Skywork-R1V2-38B-AWQ", trust_remote_code=True) 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 AutoModel model = AutoModel.from_pretrained("Skywork/Skywork-R1V2-38B-AWQ", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Skywork/Skywork-R1V2-38B-AWQ with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Skywork/Skywork-R1V2-38B-AWQ" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Skywork/Skywork-R1V2-38B-AWQ", "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/Skywork/Skywork-R1V2-38B-AWQ
- SGLang
How to use Skywork/Skywork-R1V2-38B-AWQ 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 "Skywork/Skywork-R1V2-38B-AWQ" \ --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": "Skywork/Skywork-R1V2-38B-AWQ", "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 "Skywork/Skywork-R1V2-38B-AWQ" \ --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": "Skywork/Skywork-R1V2-38B-AWQ", "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 Skywork/Skywork-R1V2-38B-AWQ with Docker Model Runner:
docker model run hf.co/Skywork/Skywork-R1V2-38B-AWQ
Unable to call this model using lmdeploy serve api_server.
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in run_code
File "E:\open-webui-0.3.35\backend\open_webui\python311\Scripts\lmdeploy.exe_main.py", line 7, in
File "E:\open-webui-0.3.35\backend\open_webui\python311\Lib\site-packages\lmdeploy\cli\entrypoint.py", line 39, in run
args.run(args)
File "E:\open-webui-0.3.35\backend\open_webui\python311\Lib\site-packages\lmdeploy\cli\serve.py", line 318, in api_server
chat_template_config = get_chat_template(args.chat_template)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\open-webui-0.3.35\backend\open_webui\python311\Lib\site-packages\lmdeploy\cli\utils.py", line 75, in get_chat_template
assert chat_template in MODELS.module_dict.keys(),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: chat template 'skywork-r1v-chat' is not registered. The builtin chat templates are: dict_keys(['base', 'llama', 'deepseek-v3', 'deepseek-r1', 'cogvlm', 'cogvlm2', 'vicuna', 'wizardlm', 'llava-v1', 'mini-gemini-vicuna', 'internlm', 'internlm2', 'internlm3', 'internvl-internlm2', 'internvl2-internlm2', 'internvl2_5', 'internlm-xcomposer2', 'internlm-xcomposer2d5', 'baichuan2', 'puyu', 'llama2', 'llama3', 'llama3_1', 'llama3_2', 'qwen', 'minicpm3', 'minicpmv-2d6', 'qwen2d5', 'qwq_preview', 'qwq', 'codellama', 'falcon', 'chatglm', 'solar', 'ultracm', 'ultralm', 'yi', 'mistral', 'mixtral', 'gemma', 'deepseek', 'internvl-zh', 'deepseek-vl', 'deepseek-vl2', 'deepseek-coder', 'yi-vl', 'dbrx', 'llava-chatml', 'internvl-zh-hermes2', 'phi-3', 'internvl2-phi3', 'chatglm3', 'glm4', 'codegeex4', 'internvl-phi3', 'molmo', 'llama4'])
We have fixed this error.
@sealical The following command works, but the think tag is missing
lmdeploy serve api_server E:\models\awq\Skywork-R1V2-38B-AWQ --backend turbomind --model-format awq --server-port 5001 --chat-template qwq --session-len 70000