00000606
docker pull harbor.iluvatar.com.cn:10443/saas/mr-bi150-4.4.0-x86-ubuntu20.04-py3.10-poc-llm-infer:v1.2.3
docker run -dit -v /usr/src:/usr/src -v /lib/modules:/lib/modules -v /dev:/dev -v /data:/data -v /home:/home --network=host --name=DeepSeek-OCR --ipc=host --privileged --cap-add=ALL --pid=host harbor.iluvatar.com.cn:10443/saas/mr-bi150-4.4.0-x86-ubuntu20.04-py3.10-poc-llm-infer:v1.2.3 /bin/bash
#进入容器
docker exec -it DeepSeek-OCR bash
#设置环境变量
export VLLM_ENFORCE_CUDA_GRAPH=1
#启动API服务
vllm serve /data/models/DeepSeek-OCR --logits_processors vllm.model_executor.models.deepseek_ocr:NGramPerReqLogitsProcessor --no-enable-prefix-caching --mm-processor-cache-gb 0 --compilation-config '{"cudagraph_mode": "FULL_DECODE_ONLY", "level": 0}'
curl -s -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
-d '{
"model": "/data/models/DeepSeek-OCR",
"messages": [{"role": "user", "content": "hi"}],
"max_tokens": 10
}' | python3 -m json.tool
curl -s -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
-d "{
\"model\": \"/data/models/DeepSeek-OCR\",
\"messages\": [
{
\"role\": \"user\",
\"content\": [
{\"type\": \"text\", \"text\": \"Please extract all text from this image character by character, preserving the original layout\"},
{\"type\": \"image_url\", \"image_url\": {\"url\": \"data:image/png;base64,$(base64 -w0 /data/test.png)\"}}
]
}
],
\"max_tokens\": 1024,
\"temperature\": 0.0
}"