Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(New Construct): LangServ Support #249

Open
1 of 2 tasks
tech4life87 opened this issue Feb 6, 2024 · 9 comments
Open
1 of 2 tasks

(New Construct): LangServ Support #249

tech4life87 opened this issue Feb 6, 2024 · 9 comments
Assignees
Labels
RFC-proposal RFC Proposal - used for tracking through process on Project board. NOT an "issue" as such.

Comments

@tech4life87
Copy link

tech4life87 commented Feb 6, 2024

Describe the feature

This construct deploys Langserv a FastAPI based framework that helps developers deploy LangChain's Runnables and Chains as REST API in production.

Use Case

Langserv simplifies the deployment of Large language Models from a prototype to production with industry best practices such as

  1. API docs page with JSONSchema and Swagger
  2. Efficient /invoke/, /batch/ and /stream/ endpoints with support for many concurrent requests on a single server
  3. All built with battle-tested open-source Python libraries like FastAPI, Pydantic, uvloop and asyncio
  4. FastAPI is a modern, fast (high-performance), web framework for building APIs with Python 3.8+ based on standard Python type hints.
  5. Observability and Analytics
  6. LLM Provider Agnostic

Proposed Solution

At a high level this construct will deploy LangServ and LangFuse on AWS using Services such as Fargate, ECS and RDS but will depend on existing constructs such as aws_ecs_patterns. Developers will be able to make custom REST api calls to FastAPI endpoints with support for streaming, batch and invoke. The construct will be LLM provider agnostic such as Bedrock, SageMaker or VLLM on EC2 Instances giving developers flexibility to experiment with different model providers.
The construct will also provide monitoring and observability capability using LangFuse giving developers the flexibility to trace and debug LLM applications, monitor latency and model evaluation capabilities.

No response

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

Tasks

No tasks being tracked yet.
@tech4life87 tech4life87 added the needs-triage This issue or PR still needs to be triaged. label Feb 6, 2024
@laithalsaadoon
Copy link
Contributor

Thank you for the suggestion @tech4life87 ! Do you mind describing a few things for us:

  1. At a high level, how do you propose deploying and running LangServe on AWS? (i.e. what resources, services, etc.)
  2. Is a LangServe construct related to or enhanced by existing constructs, and if so, how?
  3. At a high level, do you propose that users should be able to make custom REST APIs with LangServe, and if so, what would be the "entrypoint" for providing their Chains and Runnables?

@tech4life87
Copy link
Author

@laithalsaadoon I just updated the issue with these details.

@krokoko
Copy link
Collaborator

krokoko commented Feb 11, 2024

Hi @tech4life87 , thank your for this suggestion, looks very interesting !

  1. Do you have an idea of the interface for this construct ?
  2. Could you walk me through the developer workflow for this construct ?

@krokoko
Copy link
Collaborator

krokoko commented Feb 26, 2024

@tech4life87 any update on this one ?

@tech4life87
Copy link
Author

@krokoko

  1. Yes I have an idea of how this would work from my previous work on the same thing.

  2. From a developer experience/flow perspective there are two possible paths and I am open to refining it.

    1. Developer imports the constructs which default to pulling the container from a public ecr repo.
    2. They do local development and local testing.
    3. during CDK deploy the container is packaged and deployed to ECS.

    options2:

    1. Developer create a local langserve application.
    2. The developer then does local development and testing.
    3. Using the local Dockefile the construct packages the code and deploys to ECS.

    I open to ideas of what other developers have done to improve dev experience when it comes to fargate based constructs.

@krokoko krokoko added RFC-proposal RFC Proposal - used for tracking through process on Project board. NOT an "issue" as such. and removed needs-triage This issue or PR still needs to be triaged. labels Feb 29, 2024
@krokoko
Copy link
Collaborator

krokoko commented Mar 1, 2024

great @tech4life87 , thanks ! I see you mentioned you may be able to implement this feature, would you be able to create a draft of this construct in a branch ?

@tech4life87
Copy link
Author

great @tech4life87 , thanks ! I see you mentioned you may be able to implement this feature, would you be able to create a draft of this construct in a branch ?

Yes I will start working on it

@krokoko
Copy link
Collaborator

krokoko commented Mar 11, 2024

Thank you @tech4life87 ! I will assign the ticket to you for now

@krokoko
Copy link
Collaborator

krokoko commented May 7, 2024

Hi @tech4life87 , any update on this ? Thank you !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFC-proposal RFC Proposal - used for tracking through process on Project board. NOT an "issue" as such.
Projects
Development

No branches or pull requests

3 participants