You need to enable JavaScript to run this app.
Lake AI Service

Lake AI Service

Copy page
Download PDF
Video understanding
Visual content understanding (Doubao-1.5-vision-pro-32k)
Copy page
Download PDF
Visual content understanding (Doubao-1.5-vision-pro-32k)

Operator introduction

Description

Large model multimodal understanding processor
Use VeArk's large model to analyze and interpret images, videos, or text, and return the output as text.

Key features

  • Multimodal scenario support: Supports any combination of images, videos, and text as input. The operator automatically constructs a message structure that complies with multimodal model specifications.
  • Rich input sources: Supports http/https/tos/s3 protocol URLs, Base64 encoding, and raw binary data. TOS/S3 addresses are automatically pre-signed.
  • Flexible data formats: The image, video, and text columns all accept string (single) or list (multiple) input formats.

Input and output specifications

  • Input format:
    • images (image): string or list type.
    • videos (video): string or list type.
    • texts (text): string or list type, used as user prompts.
  • Output format:
    • Default mode: Returns a model-generated result of string type.
    • Diagnostic mode: When the environment variable LAS_LLM_FINISH_REASON_CHECK=true is set, returns a struct type containing:
      • llm_result: The text result generated by the model.
      • finish_reason: The reason for model output termination. Possible values include stop (normal completion), length (maximum length reached), and content_filter (content filtering).

Version compatibility notes

This operator (ArkLLMVisionUnderstanding) is used differently in Daft 0.6.5 (and earlier versions) compared to Daft 0.6.14 (and later versions).

  • In Daft 0.6.14 and later versions, you can specify the images, texts, and videos fields as input, corresponding to the model's image, text, and video inputs. Simultaneous input is supported. Here is an example:

    df = df.with_column(
    
            "llm_result",
    
            las_udf(
    
                ArkLLMVisionUnderstanding,
    
                construct_args={
    
                    "model": "doubao-1.5-vision-pro-32k",
    
                    "system_text": "",
    
                    "inference_type": "online",
    
                },
    
            )(videos=col("video_urls"), texts=col("prompts")),
    
        )
    
  • In Daft 0.6.5 and earlier versions, only video or image can be provided as input, and simultaneous input of video and image is not supported. The input type is specified via multimodal_type, which supports "video", "image", and "text". It also supports providing text information by specifying the prompt parameter. Here is an example:

    df = df.with_column(
    
            "llm_result",
    
            las_udf(
    
                ArkLLMVisionUnderstanding,
    
                construct_args={
    
                    "model": "doubao-1.5-vision-pro-32k",
    
                    "multimodal_type": "video",
    
                    "prompt": "",
    
                    "inference_type": "online",
    
                },
    
            )(col("videos")),
    
        )
    

Daft invocation

Operator parameters

Input

Input column name

Note

images

Provide the image data to be processed. Supports passing a single image (string) or multiple images (list). The data source is controlled by the source_type parameter: the url mode supports http/https/tos/s3 and other protocol addresses, where tos/s3 will be automatically converted to a pre-signed URL; the base64 mode uses the image's Base64 encoding; the binary mode automatically converts binary data to Base64 encoding.

videos

Provide the video data to be processed. Supports passing a single video (string) or multiple videos (list). The data source and processing method are the same as the images column.

texts

Provide user text prompts. Supports passing a single text (string) or multiple texts (list).

Output

By default, the return field type is string, and the returned content is the model output result.
When the environment variable LAS_LLM_FINISH_REASON_CHECK=true is set, the return field type is struct, containing the following fields:

  • llm_result: Model output result
  • finish_reason: Reason for model output termination. Common values include stop (normal termination), length (maximum length reached), and content_filter (content filtering policy triggered).

Parameters

If a parameter does not have a default value, it is a required parameter.

Parameter name

Type

Default value

Description

model

str

(Required) Model name. Fixed as doubao-1.5-vision-pro-32k.

version

str

Model version. For example, 250115.

inference_type

str

batch

Inference type. Supports online inference and batch inference. Optional values: online, batch.

system_text

str

System prompt content. Used as input to the model in the system role to uniformly constrain model behavior.

system_image_url

str

System image URL. Used to guide model behavior.

system_video_url

str

System video URL. Used to guide model behavior.

image_format

str

jpeg

Image encoding format. Supports common formats such as JPEG, PNG, WEBP, and GIF.

image_url_detail

str

Image quality. Value range: high, low, auto.

video_format

str

mp4

Video encoding format. Supports MP4, AVI, and MOV.

video_fps

float

1.0

Video frame rate. Value range: [0.2, 5].

source_type

str

url

Media data source format. Optional values: binary, base64, url.

max_tokens

int

Maximum length of model response (in tokens).

max_completion_tokens

int

Maximum number of tokens generated by the model.

stop

list[str]

Stop word list. The model will stop generating when it encounters the specified string.

frequency_penalty

float

0

Frequency penalty coefficient. Value range: [-2.0, 2.0].

presence_penalty

float

0

Presence penalty coefficient. Value range: [-2.0, 2.0].

temperature

float

1.0

Sampling temperature. Value range: [0, 2].

top_p

float

0.7

Nucleus sampling probability threshold.

logit_bias

dict

Adjusts the probability of specified tokens appearing in the output.

tools

list

Tools to be invoked.

llm_config

dict

Other custom parameters forwarded to the model.

request_timeout

int

1200

Timeout for a single request (seconds).

max_concurrency

int

100

Maximum concurrency per process.

Examples

The following code demonstrates how to use this operator to interpret images.

from __future__ import annotations
import os
import daft
from daft import col
from daft.las.functions.ark_llm.ark_llm_vision_understanding import ArkLLMVisionUnderstanding
from daft.las.functions.udf import las_udf

if os.getenv("DAFT_RUNNER", "native") == "ray":
    import logging

    import ray

    def configure_logging():
        logging.basicConfig(
            level=logging.INFO,
            format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
            datefmt="%Y-%m-%d %H:%M:%S.%s".format(),
        )
        logging.getLogger("tracing.span").setLevel(logging.WARNING)
        logging.getLogger("daft_io.stats").setLevel(logging.WARNING)
        logging.getLogger("DaftStatisticsManager").setLevel(logging.WARNING)
        logging.getLogger("DaftFlotillaScheduler").setLevel(logging.WARNING)
        logging.getLogger("DaftFlotillaDispatcher").setLevel(logging.WARNING)

    ray.init(dashboard_host="0.0.0.0", runtime_env={"worker_process_setup_hook": configure_logging})
    daft.set_runner_ray()

daft.set_execution_config(min_cpu_per_task=0)
  
if __name__ == "__main__":
    # The environment variable LAS_API_KEY must be configured: LAS_API_KEY can be created and obtained on the LAS service page
    tos_dir_url = os.getenv("TOS_DIR_URL", "las-cn-beijing-public-online.tos-cn-beijing.volces.com")
    samples = {
        "image_urls": [
            f"https://{tos_dir_url}/public/shared_image_dataset/cat_ip_adapter.jpeg"
        ],
        "prompts": [""],
    }

    df = daft.from_pydict(samples)
    df = df.with_column(
        "llm_result",
        las_udf(
            ArkLLMVisionUnderstanding,
            construct_args={
                "model": "doubao-1.5-vision-pro-32k",
                "system_text": "",
                "inference_type": "online", # This model only supports online inference
            },
        )(images=col("image_urls"), texts=col("prompts")),
    )
    df.show()

    # Output (Each inference result may differ)
    # ╭────────────────────────────────┬────────────────┬─────────────────────────────────────────────────────────────╮
    # │ image_urls                     ┆ prompts        ┆ llm_result                                                  │
    # │ ---                            ┆ ---            ┆ ---                                                         │
    # │ String                         ┆ String         ┆ String                                                      │
    # ╞════════════════════════════════╪════════════════╪═════════════════════════════════════════════════════════════╡
    # │ https://las-public-data-qa.to… ┆ What is in the picture? ┆ The image features an anthropomorphic cat with cream and light brown fur, and has a pair of… │
    # ╰────────────────────────────────┴────────────────┴─────────────────────────────────────────────────────────────╯
Last updated: 2026.05.24 15:38:09