examples.demo_openai_image¶
Demo: OpenAI API - Image Analysis Shows how to use vllm-mlx with the OpenAI Python SDK for image understanding.
View the complete module source at #L1-L137.
API details¶
Each callable below includes its exact signature, type annotations, inputs, defaults, return contract, documented exceptions, implementation source, and parsed docstring sections when the source provides them.
examples.demo_openai_image
¶
Demo: OpenAI API - Image Analysis
Shows how to use vllm-mlx with the OpenAI Python SDK for image understanding.
Usage
-
Start the server with a VLM model ("vision-model" is the name used in the OpenAI API): vllm-mlx serve --served-model-name vision-model mlx-community/Qwen3-VL-4B-Instruct-3bit --port 8000
-
Run this script: python examples/demo_openai_image.py
examples.demo_openai_image.client
module-attribute
¶
examples.demo_openai_image.image_url
module-attribute
¶
examples.demo_openai_image.response
module-attribute
¶
examples.demo_openai_image.scene_url
module-attribute
¶
scene_url = 'https://upload.wikimedia.org/wikipedia/commons/thumb/1/10/Empire_State_Building_%28aerial_view%29.jpg/800px-Empire_State_Building_%28aerial_view%29.jpg'
examples.demo_openai_image.food_url
module-attribute
¶
food_url = 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6d/Good_Food_Display_-_NCI_Visuals_Online.jpg/800px-Good_Food_Display_-_NCI_Visuals_Online.jpg'
Complete contract reference¶
Expand any definition for its exact inputs, annotations, defaults, return contract, directly raised exceptions, source-grounded behavior, and immutable line link. This section includes private and nested definitions that ordinary API generators omit.
This module does not declare classes or functions.
Complete symbol map¶
This map also includes private definitions and nested helpers. The signature column exposes every explicit input even when an internal helper has no dedicated parameter prose.
This module does not declare classes or functions.