encode

Generate embeddings for input items.

Supports both msgpack and JSON request bodies (Content-Type header). Returns msgpack by default, JSON if Accept header requests it.

Args: model: Model name to use for encoding. http_request: FastAPI request object (for body and app state). accept: Accept header for response content negotiation. x_machine_profile: Machine profile header for routing validation.

Returns: EncodeResponse with embeddings for each input item. Format depends on Accept header: msgpack (default) or JSON.

Raises: HTTPException: 400 for invalid input or profile mismatch, 404 if model not found, 503 if not loaded.

post/v1/encode/{model}

Request

  • The document declares no server URL.
  • Auth
    none declared

Path parameters

modelstring required

Headers

acceptstring nullable
X-SIE-MACHINE-PROFILEstring nullable
X-SIE-Remotestring nullable

The only accepted value is forbid. It keeps the request off remote upstreams: local capacity serves or refuses it, and a model served only by an upstream answers 400. Any other value answers 400.

Request body

Example request

{
  "items": [
    {
      "text": "Hello, world!"
    },
    {
      "text": "How are you?"
    }
  ]
}

Response

Embeddings generated successfully

modelstring required

Model used for encoding

Changes