dify blog 09月19日
Dify集成LangSmith和Langfuse提升LLM应用监控
index_new5.html
../../../zaker_core/zaker_tpl_static/wap/tpl_guoji1.html

 

Dify版本0.6.12整合了LangSmith和Langfuse两款强大的LLM应用监控工具,通过简单配置即可获取详细应用数据,便于评估Dify上LLM应用的成本、延迟和质量。LLM应用开发中,其内部机制如同黑箱,操作监控至关重要。Dify借助LangSmith和Langfuse提供全面的LLMOps支持,包括选择合适模型、创建有效提示、监控性能、持续改进和成本优化。LangSmith由LangChain团队开发,提供深度追踪和评估功能;Langfuse作为开源平台,支持复杂用例且性能开销低。在Dify中配置后,应用数据自动传输至这些平台,助力开发者优化LLM应用。

🔍 Dify 0.6.12整合了LangSmith和Langfuse,通过简单配置即可获取LLM应用的详细数据,包括成本、延迟和质量评估,便于开发者监控和优化应用性能。

🛠️ LangSmith由LangChain团队开发,提供深度追踪和评估功能,支持多种评估方式如 pairwise testing、LLM-as-a-judge 和自定义评估器,帮助开发者深入了解应用表现。

🌐 Langfuse作为开源平台,支持复杂用例且性能开销低,其特点包括容器化部署、全功能API、数据导出、框架无关的追踪和分析,以及自动化评估和人工标注工作流,适合需要自主部署和安全保障的用户。

🚀 在Dify中配置LangSmith和Langfuse后,应用数据自动传输至这些平台,开发者可在项目管理界面查看详细性能指标、成本数据和使用信息,实现高效的LLM应用监控和持续改进。

💡 此集成推动了透明高效的LLM应用开发新标准,Dify将持续探索LLMOps边界,赋能开发者充分发挥LLM潜力。

In our ongoing effort to foster a more open and robust LLM ecosystem, Dify version 0.6.12 has integrated LangSmith and Langfuse, two powerful LLM application observability tools. With simple configuration, you can now access detailed application data, making it easier to evaluate the cost, latency, and quality of LLM applications created on Dify.

What is LLMOps?

While LLMs exhibit remarkable inference and text generation capabilities, their internal workings remain a black box, presenting challenges in LLM-based application development. LLM applications created with Dify Workflow often involve multiple nodes and high complexity, making operational monitoring crucial - see what's happening with your application, so you can take action when needed.

In our latest integration, Dify leverages LangSmith and Langfuse to provide comprehensive LLMOps support, including:

  1. Selecting suitable models: Dify supports mainstream LLMs, allowing you to choose the most appropriate model for your specific needs.

  2. Creating effective prompts: Dify offers an intuitive prompt editing interface, which, combined with LangSmith and Langfuse, enables detailed tracking and analysis of prompt effectiveness.

  3. Monitoring performance: Through LangSmith and Langfuse, you can comprehensively monitor LLM applications created on Dify, tracking accuracy, latency, and resource utilization.

  4. Continuous improvement: LangSmith and Langfuse offer detailed monitoring metrics. These metrics, combined with manual annotation of LLM responses, allow you to continuously optimize your applications and enhance user experience.

  5. Cost optimization: Dify provides basic resource usage statistics, while LangSmith and Langfuse complement this with detailed cost and token usage analysis, helping you optimize resource allocation efficiently.

Why LangSmith and Langfuse?

LangSmith and Langfuse are two advanced LLM application performance monitoring tools that offer comprehensive support for Dify users in developing and optimizing LLM applications.

LangSmith, developed by the LangChain team, provides extensive tracing capabilities and in-depth evaluations, helping teams monitor LLM complex applications as they scale. LangSmith provides rich evaluation features that can be run directly from prompts, including:

  • Pairwise and regression testing

  • LLM-as-a-judge (i.e. using an LLM to score outputs) for fine-tuning, including off-the-shelf RAG evaluators

  • Custom evaluators for tasks like code generation

Langfuse, as an open-source platform, offers low performance overhead and excellent support for complex use cases. Key features include:

  • Open-source and self-hostable architecture with easy deployment 

  • Fully-featured API and data exports that allow to build downstream use cases

  • Framework agnostic tracing and analytics

  • Automated evaluation, custom eval pipelines, and human annotation workflows

  • Datasets for benchmarking different experiments, collecting few-shot examples, and fine-tuning

Notably, Langfuse is open source (MIT-licensed) and supports self-hosting through a containerized deployment. It can be deployed freely and through a single container which makes it attractive for users that have security requirements or simply prefer to run on their own infrastructure. 

How do they work with Dify?

Using LangSmith and Langfuse in Dify is straightforward. After creating an application, you can enable these tools with just one-click configuration on the overview page.

Once configured, usage data from your Dify-created applications will be automatically transmitted to these platforms. In the project management interfaces of LangSmith and Langfuse, you can view detailed performance metrics, cost data, and usage information to optimize your applications on Dify.

Looking Ahead

With the integration of LangSmith and Langfuse, Dify 0.6.12 sets a new standard for transparent and efficient LLM application development. But we're just getting started. Our mission is to continually push the boundaries of what's possible in LLMOps, empowering developers to harness the full potential of LLM. Stay tuned!

Fish AI Reader

Fish AI Reader

AI辅助创作,多种专业模板,深度分析,高质量内容生成。从观点提取到深度思考,FishAI为您提供全方位的创作支持。新版本引入自定义参数,让您的创作更加个性化和精准。

FishAI

FishAI

鱼阅,AI 时代的下一个智能信息助手,助你摆脱信息焦虑

联系邮箱 441953276@qq.com

相关标签

Dify LangSmith Langfuse LLM应用监控 LLMOps 性能优化
相关文章