For the complete documentation index, see llms.txt. This page is also available as Markdown.

LMM

Run a large multimodal model such as ChatGPT-4v.

Ask a question to a Large Multimodal Model (LMM) with an image and text.

You can specify arbitrary text prompts to an LMMBlock.

The LLMBlock supports two LMMs:

  • OpenAI's GPT-4 with Vision;

You need to provide your OpenAI API key to use the GPT-4 with Vision model.

If you want to classify an image into one or more categories, we recommend using the dedicated LMMForClassificationBlock.

Type identifier

Use the following identifier in step "type" field: roboflow_core/lmm@v1 to add the block as a step in your workflow.

Properties

Name

Type

Description

Refs

name

str

Enter a unique identifier for this step..

prompt

str

Holds unconstrained text prompt to LMM mode.

lmm_type

str

Type of LMM to be used.

lmm_config

LMMConfig

Configuration of LMM.

remote_api_key

str

Holds API key required to call LMM model - in current state of development, we require OpenAI key when lmm_type=gpt_4v..

json_output

Dict[str, str]

Holds dictionary that maps name of requested output field into its description.

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.

hard - runtime hosted_serverless; execution remote : LMM_ENABLED=False on Roboflow Hosted Serverless: the /llm_v1 endpoint is not registered, so run_remotely() returns 404.

Input and Output Bindings

The available connections depend on its binding kinds. Check what binding kinds LMM in version v1 has.

Input and output bindings
  • input

    • images (image): The image to infer on..

    • prompt (string): Holds unconstrained text prompt to LMM mode.

    • lmm_type (string): Type of LMM to be used.

    • remote_api_key (Union[secret, string]): Holds API key required to call LMM model - in current state of development, we require OpenAI key when lmm_type=gpt_4v..

  • output

    • parent_id (parent_id): Identifier of parent for step output.

    • root_parent_id (parent_id): Identifier of parent for step output.

    • image (image_metadata): Dictionary with image metadata required by supervision.

    • structured_output (dictionary): Dictionary.

    • raw_output (string): String value.

    • * (*): Equivalent of any element.

Example JSON definition

Last updated

Was this helpful?