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