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

Lake AI Service

Copy page
Download PDF
Multimodal vectorization
Image-text embedding (Doubao series models)
Copy page
Download PDF
Image-text embedding (Doubao series models)

Operator introduction

Description

Multimodal vector generation processor

Key features

  • Multimodal vectorization support: Supports joint vector generation for images, videos, and text, enabling cross-modal retrieval capabilities.
  • Input format adaptation:
    • Natively supports input formats such as base64 encoding, binary data, and URLs for images and videos
    • Automatically handles media format conversion (JPEG/PNG/MP4/AVI and more)
  • Model name: doubao-embedding-vision

Input and output specifications

  • Input format:
    • Image/video data/text data: string type, supports base64 encoding/URLs
  • Output format:
    • Default mode: vector representation as a float array

Cautions and prerequisites

Details

Caution and prerequisites

Costs

Before calling an operator, you need to understand the model invocation costs associated with using the operator. For details, see Large model invocation billing.

Authentication (API Key)

Before calling an operator, you need to generate an API Key for operator invocation. It is recommended to configure the API Key as an environment variable to ensure safer operator calls. For details, see Obtain and configure API Key.

BaseURL

Before calling an operator, you need to determine the BaseURL for operator invocation based on the region where your current LAS service is deployed. This is used to configure the path parameter values for operator calls.
For details, see Obtain the Base URL. The Examples below are for reference only; when making actual calls, replace the path values with those corresponding to your region.

Online experience

LAS provides you with the "Online Experience" capability and a certain amount of free trial quota. No configuration is required to experience the data processing effect of the LAS operator online.

warning

The current operator's online experience allows free usage of up to 500,000 tokens of model consumption. Any excess will be billed according to the operator's billing items. For details on each operator's billing items and logic, see Large model billing.

Online experience entry

After logging in and entering the LAS Console , locate the current operator card, hover the mouse over the operator card, and click the "online experience" button.
Image

Online experience operation demonstration

  • LAS provides you with multiple sample image-text and video files. You can also delete sample files and upload them manually.
  • During the online experience, you can flexibly set the operator's processing parameters.

API invocation

POST https://operator.las.ap-southeast-1.volces.com/api/v1/embeddings/multimodal

API description

Invoke this operator to perform image-text vectorization.

Request parameters

Parameter

Type

Required

Example value

Description

model

string

Yes

doubao-embedding-vision

Model name, only doubao-embedding-vision is supported

input

list of object

Yes

List of content to be vectorized. For detailed information, refer to the input parameter in the request parameters.

encoding_format

string

No

float

The format returned by the embedding process. Value range: float, base64, null. Default is float.

dimensions

integer

No

2048

Specifies the output vector dimension. This parameter is only supported in doubao-embedding-vision-250615 and later versions.
Value range: 1024 or 2048. Default is 2048

instructions

string

No

Inference prompt. If provided by the user, it is used directly; if not provided, a default value is generated based on the input modality. For details, see in the .

sparse_embedding

object

No

Sparse vector switch configuration. This field can only be configured for pure text input. Value range:

  • type="disabled": Only outputs dense vectors, does not output sparse vectors;
  • type="enabled": Outputs both dense and sparse vectors.

Response parameters

Parameter name
Type
Example
描述
id
string
021743575029461acbe49a31755bec77b2f09448eb15fa9a88e47
Unique identifier of this request.
model
string
doubao-embedding-vision-250615
Actual model name and version used for this request.
created
integer
1743575029
Unix timestamp (seconds) of when this request was created.
object
string
list
Fixed value: list.
data
embedding_result
Algorithm output of this request.
usage
token_usage
Token usage of this request.

Examples

Request example

curl --location "https://operator.las.ap-southeast-1.volces.com/api/v1/embeddings/multimodal" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer $LAS_API_KEY" \
--data '{
    "model": "doubao-embedding-vision-250615",
    "encoding_format": "float",
    "input": [
        {
            "type": "image_url",
            "image_url": {
                "url": "https://las-ai-cn-beijing-baseline.tos-cn-beijing.volces.com/operator_cards_serving/public/baseline/doubao_embedding_vision/cat_ip_adapter.jpeg"
            }
        },
        {
            "type": "text",
            "text": "图片里有什么"
        }
    ]
}'

Response example

{
    "id": "021764041607868c64dcafb5669f61b8aa56083c290255748bdbb",
    "created": "1764041608",
    "model": "doubao-embedding-vision-250615",
    "object": "list",
    "data": {
        "object": "embedding",
        "embedding": [
            0.0002918243408203125,
            -0.0189208984375,
            -0.003814697265625,
            0.058349609375,
            -0.002838134765625,
            0.032958984375,
            "..."
        ]
    },
    "usage": {
        "prompt_tokens": 1335,
        "total_tokens": 1335,
        "prompt_tokens_details": {
            "text_tokens": 23,
            "image_tokens": 1312
        }
    }
}

Daft invocation

Operator parameters

Input

Input column name

Description

media_datas

Provide image or video data, or text data to be processed. Image or video data supports base64 encoding, URL, or bytes; text data supports text input. If text data is provided, the text data will be vectorized.

text_contents

In multimodal vectorization scenarios, provide image or video data via the media_datas field and text data via the text_contents field. The text content input to the model must meet the following conditions: each individual text must be encoded in UTF-8 and must not exceed 100,000 bytes in length. Each individual text must not exceed the model's maximum input token count of 8k.

Output

Returns the vectorized array processed by the model. Type is list[float]

Parameters

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

Parameter name

Type

Default value

Description

model

str

doubao-embedding-vision

version

str or None

Model version. Enter the corresponding version information for the model. Example: 250115

api_key

str or None

multimodal_type

str

image

Media content type. Specify whether to process an image or a video; the default is image. Optional values: - image: image - video: video - text: text

image_format

str

jpeg

Image encoding format. Supported formats are: JPEG, PNG, WEBP, BMP, TIFF, ICO, DIB, ICNS, SGI, JPEG2000. Among the supported formats are TIFF, SGI, ICNS, and JPEG2000.

video_format

str

mp4

Video encoding format. Configure the video format; the default is mp4. Supported video formats: MP4, AVI, MOV.

source_type

str

url

Data source type. Specify the source format of the media data; the default is url. Optional values: - binary: raw binary data - base64: Base64-encoded data - url: web resource address (supports http/https/tos)

encoding_format

str or None

Encoding format for embedding. Supported encoding formats are: float, base64

dimensions

int

2048

Embedding dimension. Used to specify the output vector dimension. This parameter is only supported by doubao-embedding-vision-250615 and later versions; for earlier versions, refer to vector dimensionality reduction. Value range: 1024 or 2048. Default value: 2048

request_timeout

int

1200

Timeout. The timeout duration for a single request (in seconds).

max_concurrency

int

100

Concurrency. Maximum concurrency per process.

Examples

The following code demonstrates how to use daft to access the ModelArk image vectorization model for vector computation.

from __future__ import annotations

import os

import daft
from daft import col
from daft.las.functions.ark_llm.doubao_embedding_vision import DoubaoEmbeddingVision
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__":
    # You need to configure the environment variable LAS_API_KEY: LAS_API_KEY is obtained by creating it 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_path": [
            f"https://{tos_dir_url}/public/shared_image_dataset/cat_ip_adapter.jpeg"
        ],
        "text": ["猫"],
    }

    df = daft.from_pydict(samples)
    # Calculate vectorized data for images and text
    df = df.with_column(
        "embeeding_for_image_text",
        las_udf(
            DoubaoEmbeddingVision,
            construct_args={
                "image_format": "jpeg",
            },
        )(col("image_path"), col("text")),
    )

    # Calculate vectorized data for images
    df = df.with_column(
        "embeeding_for_image",
        las_udf(
            DoubaoEmbeddingVision,
            construct_args={
                "image_format": "jpeg",
            },
        )(col("image_path")),
    )

    # Calculate vectorized data for text
    df = df.with_column(
        "embeeding_for_text",
        las_udf(
            DoubaoEmbeddingVision,
            construct_args={
                "multimodal_type": "text",
            },
        )(col("text")),
    )
    df.show()

    #  Output (the result of each large model inference may vary)
    # ╭────────────────────────────────┬────────┬────────────────────────────────┬────────────────────────────────┬────────────────────────────────╮
    # │ image_path                     ┆ text   ┆ embeeding_for_image_text       ┆ embeeding_for_image            ┆ embeeding_for_text             │
    # │ ---                            ┆ ---    ┆ ---                            ┆ ---                            ┆ ---                            │
    # │ String                         ┆ String ┆ List[Float32]                  ┆ List[Float32]                  ┆ List[Float32]                  │
    # ╞════════════════════════════════╪════════╪════════════════════════════════╪════════════════════════════════╪════════════════════════════════╡
    # │ https://las-public-data-qa.to… ┆ cat    ┆ [0.010437012, -0.009399414, -… ┆ [0.0076293945, -0.014404297, … ┆ [0.019165039, 0.007598877, -0… │
    # ╰────────────────────────────────┴────────┴────────────────────────────────┴────────────────────────────────┴────────────────────────────────╯
Last updated: 2026.05.22 16:01:22