Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /PascalNobereit_langserve /examples /llm /server.py
| #!/usr/bin/env python | |
| """Example LangChain server exposes multiple runnables (LLMs in this case).""" | |
| from fastapi import FastAPI | |
| from langchain_anthropic import ChatAnthropic | |
| from langchain_openai import ChatOpenAI | |
| from langserve import add_routes | |
| app = FastAPI( | |
| title="LangChain Server", | |
| version="1.0", | |
| description="Spin up a simple api server using Langchain's Runnable interfaces", | |
| ) | |
| add_routes( | |
| app, | |
| ChatOpenAI(), | |
| path="/openai", | |
| ) | |
| add_routes( | |
| app, | |
| ChatAnthropic(), | |
| path="/anthropic", | |
| ) | |
| if __name__ == "__main__": | |
| import uvicorn | |
| uvicorn.run(app, host="localhost", port=8000) | |
Xet Storage Details
- Size:
- 629 Bytes
- Xet hash:
- 479af22a785a0662cf22abca9aaee4a439b4c89d54e2b8c841f7b8ee40def137
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.