Lightning-AI / Lightning-AI/LitServe
Run a mix of async and non-async methods in LitAPI like FastAPI
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3.9k
- Forks
- 304
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 6
Description
## 🚀 Feature
LitAPI can automatically identify if the function is a coroutine and run accordingly.
```py
class MyAPI(ls.LitAPI):
def predict(self, x):
return y
async def encode_response(self, out):
return {"output": out}
```
### Motivation
### Pitch
### Alternatives
### Additional context
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the LitAPI request-dispatch entry point and inspect how methods are currently invoked. Confirm how coroutine detection should support the shown sync predict and async encode_response combination, then add coverage for mixed async and non-async methods and verify both paths complete correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- fastapi, python
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100