Lightning-AI / Lightning-AI/LitServe
Allow to pass `default_response_class` e.g. `ORJSONResponse` to LitServe server
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3.9k
- Forks
- 304
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 6
Description
----
## 🚀 Feature
Allow to pass `default_response_class` e.g. `ORJSONResponse` downstream to the underlying `FastAPI` app.
### Motivation
I really love LitServe, but one thing that I feel is missing is the ability to set the default response class.
After some research and informal experiments with the [orjson project](https://github.com/ijl/orjson) I experienced certain efficiency gains that I'd like to carry over to my LitServe projects.
Do you think it would be worth it to allow for such downstream param passing? If so, I'd be happy to submit a PR :)
### Pitch
Passing custom response classes to the `FastAPI` like `ORJSONResponse` might be a convenient feature with potential of speeding up the serialization and deserialization of JSON.
### Additional context
This approach is also referenced in `FastAPI` docstrings:
https://github.com/fastapi/fastapi/blob/b0215699137c41a96c57f650640cb9db1c25314a/fastapi/applications.py#L369
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 by locating where LitServe constructs its underlying FastAPI app and compare the `default_response_class` parameter in FastAPI's linked `applications.py`. Done means the server accepts a custom response class such as `ORJSONResponse` and passes it to the underlying FastAPI app.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- fastapi, python
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100