Skip to content

Support for adapter-specifc pre/post processing through the adapter management APIs#2951

Merged
Lokiiiiii merged 16 commits intomasterfrom
loki-pre-post-processing-for-adapter
Nov 25, 2025
Merged

Support for adapter-specifc pre/post processing through the adapter management APIs#2951
Lokiiiiii merged 16 commits intomasterfrom
loki-pre-post-processing-for-adapter

Conversation

@Lokiiiiii
Copy link
Copy Markdown
Member

@Lokiiiiii Lokiiiiii commented Nov 17, 2025

Description

Customers are consolidating their model deployments utilizing Multi-Lora to enhance efficiency through multi-tenancy. However, they have distinct pre/post processing requirements for each adapter. Given that the pre/post processing logic is tied to the adapter, it is necessary to manage them as a cohesive unit, ensuring they are created, updated, and deleted in unison.

What’s missing ? Currently, LMI supports custom pre/post processing scripts that are specified statically during the deployment of base models. However, LMI lacks the capability to dynamically register pre/post processing scripts at the time of adapter registration.

Design

  1. Check for model.py & custom formatters when registering adapters
  2. During inference adapter specific formatters override the base model formatters if specified

Additional

  1. New integ tests added and executed - https://github.com/deepjavalibrary/djl-serving/actions/runs/19585974385
  2. Existing documentation updated and new documentation added
  3. Examples/demos WIP

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

Checklist:

Feature/Issue validation/testing

Please describe the Unit or Integration tests that you ran to verify your changes and relevant result summary. Provide instructions so it can be reproduced.
Please also list any relevant details for your test configuration.

  • Test A
    Logs for Test A

  • Test B
    Logs for Test B

@@ -0,0 +1,229 @@
#!/usr/bin/env python
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is a just a refactor of the adapter code that was in async_utilts before.

@Lokiiiiii Lokiiiiii marked this pull request as ready for review November 19, 2025 23:56
@Lokiiiiii Lokiiiiii requested review from a team and zachgk as code owners November 19, 2025 23:56
@Lokiiiiii Lokiiiiii marked this pull request as draft November 19, 2025 23:58
@Lokiiiiii Lokiiiiii marked this pull request as ready for review November 22, 2025 01:05
Copy link
Copy Markdown
Contributor

@ksuma2109 ksuma2109 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Custom Formatter specific code LGTM

@Lokiiiiii Lokiiiiii merged commit 1c16bc2 into master Nov 25, 2025
7 of 9 checks passed
@Lokiiiiii Lokiiiiii deleted the loki-pre-post-processing-for-adapter branch November 25, 2025 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants