langchain学习(二)

LangChain Expression Language (LCEL) | 🦜️🔗 Langchain

LangChain Expression Language:LCEL,langchain表达式语言,从设计之处就支持将原型投入生产而不用修改代码

为什么用langchain(而不直接调用LLM),官方文档给出以下的原因

1、“get the best possible time-to-first-token (time elapsed until the first chunk of output comes out)”--最低的平均首包延迟。时长少更少的围绕潜在延迟问题或缓慢响应的设计工作。

time-to-first-token:TTFT,LLM评估指标,表示收到 prompt 和返回第一个 token 的间隔时长。

参考Reproducible Performance Metrics for LLM inference

Time to first token (TTFT) 

In streaming applications, the TTFT is how long before the LLM returns the first token. We are interested not just in the mean TTFT, but the distribution: the P50, P90, P95 and P99.

思考:硬件上优势,langchain框架内有哪些优化

2、良好的异步表现(处理多个并发请求的能力)

思考:web框架优点

3、可以在LCELchain的任意环节配置重试和回退(Retries and fallbacks),在没有任何延迟成本的情况下获得额外的可靠性。

4、可访问中间结果,让最终用户知道发生的过程、调试

5、输入输出模式:为每个LCELchain提供从链结构推断出的Pydantic和JSONSchema模式。这可用于验证输入和输出

6、LangSmith:已集成了日志记录、用于调试的模块

7、langServe:已集成了服务器

思考:3、4、5、6的优势是关于调试的能力

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值