Skip to content

Run a mix of async and non-async methods in LitAPI like FastAPIΒ #490

@aniketmaurya

Description

@aniketmaurya

πŸš€ Feature

LitAPI can automatically identify if the function is a coroutine and run accordingly.

class MyAPI(ls.LitAPI):
    def predict(self, x):
        return y

    async def encode_response(self, out):
        return {"output": out}

Motivation

Pitch

Alternatives

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions