{
  "inputs": "The model input",
  "prompt_name": null,
  "truncate": false,
  "truncation_direction": "right"
}
[
    // Embedding 1
    [
        {
            "index": 1012,
            "value": 0.9970703
        },
        {
            "index": 4456,
            "value": 2.7832031
        }
    ],
    // Embedding 2
    [
        {
            "index": 990,
            "value": 2.783203
        },
        {
            "index": 3021,
            "value": 10.9970703
        },
        ...
    ],
    ...
]

Generating an embedding from a sparse embedding model. The main ones that we support are SPLADE models.

{
  "inputs": "The model input",
  "prompt_name": null,
  "truncate": false,
  "truncation_direction": "right"
}
[
    // Embedding 1
    [
        {
            "index": 1012,
            "value": 0.9970703
        },
        {
            "index": 4456,
            "value": 2.7832031
        }
    ],
    // Embedding 2
    [
        {
            "index": 990,
            "value": 2.783203
        },
        {
            "index": 3021,
            "value": 10.9970703
        },
        ...
    ],
    ...
]
inputs
string | string[]
required

Inputs that need to be embedded

prompt_name
string

The name of the prompt that should be used by for encoding. If not set, no prompt will be applied.

Must be a key in the sentence-transformers configuration prompts dictionary.

For example if prompt_name is “doc” then the sentence “How to get fast inference?” will be encoded as “doc: How to get fast inference?” because the prompt text will be prepended before any text to encode.

truncate
boolean
default:"false"

Automatically truncate inputs that are longer than the maximum supported size

truncate_direction
"right" | "left"
default:"right"