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.
Available Connections¶
Compatible Blocks
Check what blocks you can connect to OpenAI-Compatible LLM in version v1.
- inputs:
Distance Measurement,Detections List Roll-Up,Single-Label Classification Model,Llama 3.2 Vision,Cache Get,Heatmap Visualization,CogVLM,Keypoint Detection Model,Stability AI Image Generation,OpenRouter,Cache Set,Text Display,Image Slicer,Rate Limiter,Detections Combine,MoonshotAI Kimi,SORT Tracker,Image Blur,Byte Tracker,Camera Focus,CLIP Embedding Model,Single-Label Classification Model,Anthropic Claude,JSON Parser,Dot Visualization,Background Color Visualization,Crop Visualization,Time in Zone,SAM2 Video Tracker,Classification Label Visualization,Stability AI Outpainting,Pixel Color Count,SIFT Comparison,Google Gemini,Multi-Label Classification Model,Instance Segmentation Model,Clip Comparison,Multi-Label Classification Model,Stability AI Inpainting,BoT-SORT Tracker,LMM,Google Gemini,Cosine Similarity,QR Code Detection,Semantic Segmentation Model,Mask Area Measurement,Instance Segmentation Model,Image Convert Grayscale,Slack Notification,Size Measurement,YOLO-World Model,Anthropic Claude,Bounding Box Visualization,Florence-2 Model,SmolVLM2,Roboflow Dataset Upload,SAM 3,Google Gemma,Qwen3.5-VL,Email Notification,Camera Calibration,Motion Detection,VLM As Detector,Anthropic Claude,Gaze Detection,Dominant Color,Florence-2 Model,Identify Changes,Twilio SMS/MMS Notification,Seg Preview,Moondream2,QR Code Generator,Qwen-VL,Qwen2.5-VL,Detections Stitch,OpenAI,Detections Merge,Llama 3.2 Vision,Detections Filter,Contrast Enhancement,Circle Visualization,Image Threshold,Triangle Visualization,Keypoint Detection Model,Object Detection Model,Local File Sink,Google Vision OCR,Buffer,OpenAI,Roboflow Vision Events,Depth Estimation,SIFT Comparison,Perception Encoder Embedding Model,Instance Segmentation Model,Webhook Sink,Template Matching,Object Detection Model,Stitch Images,Roboflow Custom Metadata,Icon Visualization,Contrast Equalization,S3 Sink,CSV Formatter,Twilio SMS Notification,Keypoint Detection Model,Image Slicer,OpenAI,LMM For Classification,SAM 3,Byte Tracker,Delta Filter,Mask Edge Snap,OpenAI-Compatible LLM,Halo Visualization,Stitch OCR Detections,Color Visualization,Line Counter Visualization,VLM As Classifier,Line Counter,ByteTrack Tracker,Continue If,Ellipse Visualization,Roboflow Asset Library Attributes,Detections Classes Replacement,Google Gemma API,Halo Visualization,Morphological Transformation,Perspective Correction,Trace Visualization,Overlap Filter,Semantic Segmentation Model,Detection Event Log,Inner Workflow,VLM As Classifier,Barcode Detection,Single-Label Classification Model,Path Deviation,Model Comparison Visualization,Absolute Static Crop,Grid Visualization,Dynamic Zone,Image Preprocessing,Velocity,Detection Offset,EasyOCR,Overlap Analysis,Multi-Label Classification Model,Per-Class Confidence Filter,Qwen3.5,Time in Zone,Mask Visualization,VLM As Detector,Label Visualization,Model Monitoring Inference Aggregator,Property Definition,GLM-OCR,OC-SORT Tracker,Identify Outliers,PTZ Tracking (ONVIF),Qwen 3.6 API,Morphological Transformation,Corner Visualization,Expression,Time in Zone,Byte Tracker,Instance Segmentation Model,Reference Path Visualization,Pixelate Visualization,Email Notification,Detections Stabilizer,Data Aggregator,Camera Focus,Dynamic Crop,Relative Static Crop,OCR Model,Image Stack,SAM 3,Clip Comparison,Detections Consensus,Roboflow Dataset Upload,Detections Transformation,Qwen 3.5 API,Polygon Visualization,Google Gemini,Background Subtraction,Object Detection Model,Dimension Collapse,Qwen3-VL,MoonshotAI Kimi,Line Counter,OpenAI,Path Deviation,Environment Secrets Store,Polygon Zone Visualization,SIFT,First Non Empty Or Default,Keypoint Visualization,Polygon Visualization,Image Contours,Bounding Rectangle,Stitch OCR Detections,Blur Visualization,Segment Anything 2 Model - outputs:
Distance Measurement,OpenAI,LMM For Classification,SAM 3,Llama 3.2 Vision,OpenAI-Compatible LLM,Cache Get,Heatmap Visualization,CogVLM,Halo Visualization,Keypoint Detection Model,Stability AI Image Generation,Stitch OCR Detections,OpenRouter,Color Visualization,Cache Set,Text Display,Line Counter Visualization,Line Counter,VLM As Classifier,Ellipse Visualization,Roboflow Asset Library Attributes,MoonshotAI Kimi,Image Blur,Detections Classes Replacement,Halo Visualization,Google Gemma API,Morphological Transformation,Perspective Correction,Trace Visualization,CLIP Embedding Model,Anthropic Claude,Semantic Segmentation Model,JSON Parser,Dot Visualization,Background Color Visualization,Crop Visualization,VLM As Classifier,Time in Zone,Single-Label Classification Model,Classification Label Visualization,Path Deviation,Stability AI Outpainting,Pixel Color Count,Google Gemini,Model Comparison Visualization,Instance Segmentation Model,Image Preprocessing,Multi-Label Classification Model,Stability AI Inpainting,Time in Zone,LMM,Mask Visualization,VLM As Detector,Google Gemini,Label Visualization,Model Monitoring Inference Aggregator,Instance Segmentation Model,GLM-OCR,Slack Notification,Size Measurement,YOLO-World Model,Anthropic Claude,Bounding Box Visualization,Florence-2 Model,PTZ Tracking (ONVIF),Qwen 3.6 API,Roboflow Dataset Upload,SAM 3,Morphological Transformation,Google Gemma,Email Notification,Corner Visualization,Time in Zone,VLM As Detector,Instance Segmentation Model,Anthropic Claude,Reference Path Visualization,Email Notification,Twilio SMS Notification,Dynamic Crop,Florence-2 Model,Twilio SMS/MMS Notification,Moondream2,Seg Preview,QR Code Generator,Qwen-VL,SAM 3,Detections Stitch,Clip Comparison,OpenAI,Roboflow Dataset Upload,Llama 3.2 Vision,Qwen 3.5 API,Polygon Visualization,Google Gemini,Circle Visualization,Triangle Visualization,Image Threshold,Object Detection Model,MoonshotAI Kimi,Local File Sink,Line Counter,OpenAI,Google Vision OCR,OpenAI,Roboflow Vision Events,SIFT Comparison,Depth Estimation,Perception Encoder Embedding Model,Path Deviation,Instance Segmentation Model,Webhook Sink,Polygon Zone Visualization,Icon Visualization,Roboflow Custom Metadata,Keypoint Visualization,Contrast Equalization,S3 Sink,Polygon Visualization,Stitch OCR Detections,Segment Anything 2 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"
]
}
}