Views
No views yet
optimum-cli export openvino with the following parameters:pip install optimum[openvino]from transformers import AutoTokenizer
from optimum.intel.openvino import OVModelForCausalLM
model_id = "OpenVINO/qwen3-8b-int4-ov"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = OVModelForCausalLM.from_pretrained(model_id)
inputs = tokenizer("What is OpenVINO?", return_tensors="pt")
outputs = model.generate(**inputs, max_length=200)
text = tokenizer.batch_decode(outputs)[0]
print(text)pip install openvino-genai huggingface_hubimport huggingface_hub as hf_hub
model_id = "OpenVINO/qwen3-8b-int4-ov"
model_path = "qwen3-8b-int4-ov"
hf_hub.snapshot_download(model_id, local_dir=model_path)
import openvino_genai as ov_genai
device = "CPU"
pipe = ov_genai.LLMPipeline(model_path, device)
print(pipe.generate("What is OpenVINO?", max_length=200))ovms.exe --rest_port 8000 --source_model OpenVINO/Qwen3-8B-int4-ov --model_repository_path models --tool_parser hermes3 --reasoning_parser qwen3 --target_device GPU --cache_size 2 --task text_generationdocker run -d --user $(id -u):$(id -g) --rm -p 8000:8000 -v $(pwd)/models:/models --device /dev/dri --group-add=$(stat -c "%g" /dev/dri/render* | head -n 1) openvino/model_server:latest-gpu \
--rest_port 8000 --model_repository_path models --source_model OpenVINO/Qwen3-8B-int4-ov --tool_parser hermes3 --reasoning_parser qwen3 --target_device GPU --cache_size 2 --task text_generationpip install openaifrom openai import OpenAI
client = OpenAI(
base_url="http://localhost:8000/v3",
api_key="unused"
)
stream = client.chat.completions.create(
model="OpenVINO/Qwen3-8B-int4-ov",
messages=[{"role": "user", "content": "Hello."}],
stream=True,
extra_body={"chat_template_kwargs": {"enable_thinking": False}},
tools=[],
)
for chunk in stream:
if chunk.choices[0].delta.content is not None:
print(chunk.choices[0].delta.content, end="")