OpenAI-Compatible LLM¶
Class: OpenAICompatibleBlockV1
Source: inference.core.workflows.core_steps.models.foundation.openai_compatible.v1.OpenAICompatibleBlockV1
Send a prompt to any OpenAI-compatible API endpoint (e.g. local Qwen, vLLM, Ollama, LM Studio, or any service that implements the OpenAI chat completions API).
How this block works¶
- You provide a Base URL (e.g.
http://localhost:8000/v1) and a Model Name. - Write an Instruction — the text the model receives.
- Add rows under Inputs to feed step outputs (images, detections, text) into the request. Image inputs are base64-encoded and sent as vision content parts. A list of images becomes one vision part per image.
- Non-image inputs are converted to strings. To splice them into the instruction text, reference the input by name with the placeholder syntax shown in the Instruction field's help text.
- Optionally apply UQL operations to transform input values before insertion.
Image handling¶
- A
WorkflowImageDatavalue is JPEG-encoded and sent as animage_urlpart. - Raw JPEG
bytes(e.g. from the Image Stack block) are sent directly. - A list of either is fanned out into multiple
image_urlparts.
If an image input is also referenced in the instruction text by name, the placeholder is removed from the text — the image only travels as a vision part.
Type identifier¶
Use the following identifier in step "type" field: roboflow_core/openai_compatible@v1to add the block as
as step in your workflow.
Properties¶
| Name | Type | Description | Refs |
|---|---|---|---|
name |
str |
Enter a unique identifier for this step.. | ❌ |
base_url |
str |
URL of the OpenAI-compatible server, including /v1.. | ✅ |
model_name |
str |
Model identifier sent to the server.. | ✅ |
api_key |
str |
API key, if the endpoint requires one.. | ✅ |
system_prompt |
str |
Optional system message that sets model behavior.. | ✅ |
prompt |
str |
Text sent to the model.. | ✅ |
prompt_parameters |
Dict[str, Union[bool, float, int, str]] |
Step outputs to include in the request (images or text).. | ✅ |
prompt_parameters_operations |
Dict[str, List[Union[ClassificationPropertyExtract, ConvertDictionaryToJSON, ConvertImageToBase64, ConvertImageToJPEG, DetectionsFilter, DetectionsOffset, DetectionsPropertyExtract, DetectionsRename, DetectionsSelection, DetectionsShift, DetectionsToDictionary, Divide, ExtractDetectionProperty, ExtractFrameMetadata, ExtractImageProperty, LookupTable, Multiply, NumberRound, NumericSequenceAggregate, PickDetectionsByParentClass, RandomNumber, SequenceAggregate, SequenceApply, SequenceElementsCount, SequenceLength, SequenceMap, SortDetections, StringMatches, StringSubSequence, StringToLowerCase, StringToUpperCase, TimestampToISOFormat, ToBoolean, ToNumber, ToString]]] |
Optional UQL operations applied to inputs before use.. | ❌ |
max_tokens |
int |
Maximum tokens the model may generate.. | ❌ |
temperature |
float |
Sampling temperature, 0.0 to 2.0.. | ✅ |
extra_body |
Dict[Any, Any] |
Extra JSON forwarded as the OpenAI SDK extra_body argument.. | ❌ |
The Refs column marks possibility to parametrise the property with dynamic values available
in workflow runtime. See Bindings for more info.
Runtime compatibility¶
-
requires_internet— air-gapped / offline deployments - This block depends on a service that is not reachable from fully offline / air-gapped deployments.
Available Connections¶
Compatible Blocks
Check what blocks you can connect to OpenAI-Compatible LLM in version v1.
- inputs:
Cache Set,MoonshotAI Kimi,Path Deviation,Image Blur,SmolVLM2,Overlap Filter,Reference Path Visualization,PTZ Tracking (ONVIF),Event Writer,SAM2 Video Tracker,Clip Comparison,Object Detection Model,Email Notification,Pixelate Visualization,Qwen3-VL,JSON Parser,Anthropic Claude,Cache Get,OpenAI,Trace Visualization,Llama 3.2 Vision,Detection Event Log,ByteTrack Tracker,GLM-OCR,Camera Focus,PLC ModbusTCP,Buffer,QR Code Detection,CSV Formatter,Webhook Sink,SIFT Comparison,Image Contours,Local File Sink,Motion Detection,Google Gemini,Dimension Collapse,First Non Empty Or Default,Template Matching,Keypoint Visualization,Instance Segmentation Model,Icon Visualization,Seg Preview,Detections Transformation,Polygon Zone Visualization,Stability AI Outpainting,BoT-SORT Tracker,Byte Tracker,Halo Visualization,Expression,Distance Measurement,Morphological Transformation,VLM As Detector,Detections Consensus,Ellipse Visualization,Time in Zone,SAM 3,Size Measurement,Twilio SMS Notification,Email Notification,S3 Sink,Environment Secrets Store,Single-Label Classification Model,SAM 3,LMM For Classification,Dominant Color,Mask Area Measurement,Switch Case,OpenAI,Stitch Images,Identify Outliers,Time in Zone,Current Time,Stitch OCR Detections,Detections List Roll-Up,Pixel Color Count,Model Monitoring Inference Aggregator,Google Vision OCR,Image Threshold,Byte Tracker,Instance Segmentation Model,LMM,Polygon Visualization,Stability AI Image Generation,Line Counter Visualization,CogVLM,Relative Static Crop,Grid Visualization,Property Definition,Stitch OCR Detections,Gaze Detection,OPC UA Writer Sink,Color Visualization,Roboflow Dataset Upload,Contrast Enhancement,Absolute Static Crop,OC-SORT Tracker,OpenAI,Perspective Correction,Twilio SMS/MMS Notification,Roboflow Vision Events,Microsoft SQL Server Sink,Cosine Similarity,Perception Encoder Embedding Model,Instance Segmentation Model,Roboflow Custom Metadata,Camera Calibration,Keypoint Detection Model,Line Counter,Roboflow Asset Library Attributes,SIFT Comparison,Slack Notification,VLM As Classifier,Halo Visualization,CLIP Embedding Model,Image Stack,Google Gemma,Qwen 3.6 API,Bounding Rectangle,Dot Visualization,Label Visualization,Background Color Visualization,Llama 3.2 Vision,SAM 3 Interactive,Rate Limiter,Velocity,OpenAI-Compatible LLM,Google Gemini,Track Class Lock,Clip Comparison,OpenAI,Qwen3.5,MQTT Writer,MoonshotAI Kimi,Polygon Visualization,SIFT,Classification Label Visualization,Multi-Label Classification Model,Instance Segmentation Model,Keypoint Detection Model,Dynamic Crop,Stability AI Inpainting,Bounding Box Visualization,Multi-Label Classification Model,Crop Visualization,Continue If,Image Convert Grayscale,Mask Visualization,Delta Filter,Detections Stitch,Detection Offset,SORT Tracker,Barcode Detection,PLC EthernetIP,Anthropic Claude,Text Display,VLM As Classifier,Inner Workflow,Overlap Analysis,Roboflow Dataset Upload,Object Detection Model,Detections Filter,Detections Merge,Keypoint Detection Model,SAM3 Video Tracker,Circle Visualization,Semantic Segmentation Model,Path Deviation,Camera Focus,Identify Changes,Byte Tracker,Image Slicer,OCR Model,Heatmap Visualization,Google Gemma API,Morphological Transformation,EasyOCR,Single-Label Classification Model,YOLO-World Model,Blur Visualization,Moondream2,Florence-2 Model,Google Gemini,Corner Visualization,OpenRouter,Detections Stabilizer,Model Comparison Visualization,SAM 3,Single-Label Classification Model,Segment Anything 2 Model,Time in Zone,Mask Edge Snap,Line Counter,Qwen3.5-VL,Per-Class Confidence Filter,Image Preprocessing,Anthropic Claude,Dynamic Zone,Detections Combine,Triangle Visualization,Data Aggregator,QR Code Generator,Qwen 3.5 API,Background Subtraction,Multi-Label Classification Model,Image Slicer,Semantic Segmentation Model,Qwen-VL,Florence-2 Model,Depth Estimation,Contrast Equalization,Detections Classes Replacement,VLM As Detector,Qwen2.5-VL,Object Detection Model - outputs:
Cache Set,MoonshotAI Kimi,Roboflow Asset Library Attributes,Path Deviation,Image Blur,Reference Path Visualization,PTZ Tracking (ONVIF),Event Writer,Slack Notification,Halo Visualization,CLIP Embedding Model,VLM As Classifier,Google Gemma,Qwen 3.6 API,Dot Visualization,Label Visualization,Background Color Visualization,Llama 3.2 Vision,Email Notification,OpenAI-Compatible LLM,Google Gemini,JSON Parser,Anthropic Claude,Cache Get,OpenAI,Trace Visualization,Llama 3.2 Vision,OpenAI,Clip Comparison,GLM-OCR,MQTT Writer,Webhook Sink,SIFT Comparison,Local File Sink,Google Gemini,MoonshotAI Kimi,Polygon Visualization,Classification Label Visualization,Instance Segmentation Model,Keypoint Visualization,Instance Segmentation Model,Icon Visualization,Seg Preview,Dynamic Crop,Stability AI Inpainting,Bounding Box Visualization,Polygon Zone Visualization,Stability AI Outpainting,Multi-Label Classification Model,Crop Visualization,Mask Visualization,Halo Visualization,Detections Stitch,Distance Measurement,Anthropic Claude,Morphological Transformation,Text Display,VLM As Classifier,Roboflow Dataset Upload,VLM As Detector,Ellipse Visualization,Keypoint Detection Model,SAM3 Video Tracker,Time in Zone,SAM 3,Size Measurement,Circle Visualization,Semantic Segmentation Model,Path Deviation,Twilio SMS Notification,Email Notification,S3 Sink,SAM 3,LMM For Classification,Heatmap Visualization,Google Gemma API,OpenAI,Time in Zone,Morphological Transformation,Single-Label Classification Model,YOLO-World Model,Current Time,Stitch OCR Detections,Moondream2,Florence-2 Model,Google Gemini,Corner Visualization,OpenRouter,Pixel Color Count,Model Comparison Visualization,SAM 3,Model Monitoring Inference Aggregator,Google Vision OCR,Image Threshold,Instance Segmentation Model,LMM,Polygon Visualization,Segment Anything 2 Model,Time in Zone,Stability AI Image Generation,Line Counter Visualization,Line Counter,CogVLM,Qwen3.5-VL,Image Preprocessing,Stitch OCR Detections,Anthropic Claude,OPC UA Writer Sink,Color Visualization,Triangle Visualization,QR Code Generator,Qwen 3.5 API,Roboflow Dataset Upload,OpenAI,Qwen-VL,Florence-2 Model,Perspective Correction,Roboflow Vision Events,Microsoft SQL Server Sink,Twilio SMS/MMS Notification,Perception Encoder Embedding Model,Instance Segmentation Model,Depth Estimation,Roboflow Custom Metadata,Contrast Equalization,Detections Classes Replacement,VLM As Detector,Line Counter,Object Detection Model
Input and Output Bindings¶
The available connections depend on its binding kinds. Check what binding kinds
OpenAI-Compatible LLM in version v1 has.
Bindings
-
input
base_url(string): URL of the OpenAI-compatible server, including /v1..model_name(string): Model identifier sent to the server..api_key(Union[secret,string]): API key, if the endpoint requires one..system_prompt(string): Optional system message that sets model behavior..prompt(string): Text sent to the model..prompt_parameters(*): Step outputs to include in the request (images or text)..temperature(float): Sampling temperature, 0.0 to 2.0..
-
output
output(Union[string,language_model_output]): String value ifstringor LLM / VLM output iflanguage_model_output.error_status(string): String value.
Example JSON definition of step OpenAI-Compatible LLM in version v1
{
"name": "<your_step_name_here>",
"type": "roboflow_core/openai_compatible@v1",
"base_url": "http://localhost:8000/v1",
"model_name": "Qwen/Qwen2.5-VL-7B-Instruct",
"api_key": "xxx-xxx",
"system_prompt": "You are a helpful assistant.",
"prompt": "Describe what you see in the image.",
"prompt_parameters": {
"detections": "$steps.model.predictions",
"frames": "$steps.image_stack.frames"
},
"prompt_parameters_operations": {
"detections": [
{
"property_name": "class_name",
"type": "DetectionsPropertyExtract"
}
]
},
"max_tokens": "<block_does_not_provide_example>",
"temperature": "<block_does_not_provide_example>",
"extra_body": {
"chat_template_kwargs": {
"enable_thinking": false
},
"guided_choice": [
"A",
"B",
"C",
"D"
]
}
}