LogoLogo
  • MLServer
  • Getting Started
  • User Guide
    • Content Types (and Codecs)
    • OpenAPI Support
    • Parallel Inference
    • Adaptive Batching
    • Custom Inference Runtimes
    • Metrics
    • Deployment
      • Seldon Core
      • KServe
    • Streaming
  • Inference Runtimes
    • SKLearn
    • XGBoost
    • MLFlow
    • Spark MlLib
    • LightGBM
    • Catboost
    • Alibi-Detect
    • Alibi-Explain
    • HuggingFace
    • Custom
  • Reference
    • MLServer Settings
    • Model Settings
    • MLServer CLI
    • Python API
      • MLModel
      • Types
      • Codecs
      • Metrics
  • Examples
    • Serving Scikit-Learn models
    • Serving XGBoost models
    • Serving LightGBM models
    • Serving MLflow models
    • Serving a custom model
    • Serving Alibi-Detect models
    • Serving HuggingFace Transformer Models
    • Multi-Model Serving
    • Model Repository API
    • Content Type Decoding
    • Custom Conda environments in MLServer
    • Serving a custom model with JSON serialization
    • Serving models through Kafka
    • Streaming
    • Deploying a Custom Tensorflow Model with MLServer and Seldon Core
  • Changelog
Powered by GitBook
On this page
  • Base Codecs
  • Built-in Codecs

Was this helpful?

Edit on GitHub
Export as PDF
  1. Reference
  2. Python API

Codecs

PreviousTypesNextMetrics

Last updated 7 months ago

Was this helpful?

Codecs are used to encapsulate the logic required to encode / decode payloads following the into high-level Python types. You can read more about the high-level concepts behind codecs in thesection of the docs, as well as how to use them.

Base Codecs

All the codecs within MLServer extend from either the {class}InputCodec <mlserver.codecs.base.InputCodec> or the {class}RequestCodec <mlserver.codecs.base.RequestCodec> base classes. These define the interface to deal with input (outputs) and request (responses) respectively.

.. automodule:: mlserver.codecs
   :members: InputCodec, RequestCodec

Built-in Codecs

The mlserver package will include a set of built-in codecs to cover common conversions. You can learn more about these in thesection of the docs.

.. automodule:: mlserver.codecs
   :members: NumpyCodec, NumpyRequestCodec, StringCodec, StringRequestCodec, Base64Codec, DatetimeCodec, PandasCodec
Open Inference Protocol