Code Monkey home page Code Monkey logo

langgenius / dify Goto Github PK

View Code? Open in Web Editor NEW
45.5K 342.0 6.4K 46.99 MB

Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.

Home Page: https://dify.ai

License: Other

Python 44.67% PHP 0.05% JavaScript 0.42% Dockerfile 0.03% Shell 0.09% Mako 0.01% TypeScript 50.69% CSS 1.25% SCSS 0.17% MDX 2.55% HTML 0.07% Makefile 0.01%
ai backend-as-a-service gpt llm openai python rag orchestration gpt-4 agent

dify's Introduction

cover-v5-optimized

Dify Cloud · Self-hosting · Documentation · Enterprise inquiry

Static Badge Static Badge chat on Discord follow on Twitter Docker Pulls Commits last month Issues closed Discussion posts

README in English 简体中文版自述文件 日本語のREADME README en Español README en Français README tlhIngan Hol README in Korean README بالعربية Türkçe README README Tiếng Việt

Dify is an open-source LLM app development platform. Its intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production. Here's a list of the core features:

1. Workflow: Build and test powerful AI workflows on a visual canvas, leveraging all the following features and beyond.

optimized_workflow_intro.mp4

2. Comprehensive model support: Seamless integration with hundreds of proprietary / open-source LLMs from dozens of inference providers and self-hosted solutions, covering GPT, Mistral, Llama3, and any OpenAI API-compatible models. A full list of supported model providers can be found here.

providers-v5

3. Prompt IDE: Intuitive interface for crafting prompts, comparing model performance, and adding additional features such as text-to-speech to a chat-based app.

4. RAG Pipeline: Extensive RAG capabilities that cover everything from document ingestion to retrieval, with out-of-box support for text extraction from PDFs, PPTs, and other common document formats.

5. Agent capabilities: You can define agents based on LLM Function Calling or ReAct, and add pre-built or custom tools for the agent. Dify provides 50+ built-in tools for AI agents, such as Google Search, DALL·E, Stable Diffusion and WolframAlpha.

6. LLMOps: Monitor and analyze application logs and performance over time. You could continuously improve prompts, datasets, and models based on production data and annotations.

7. Backend-as-a-Service: All of Dify's offerings come with corresponding APIs, so you could effortlessly integrate Dify into your own business logic.

Feature comparison

Feature Dify.AI LangChain Flowise OpenAI Assistants API
Programming Approach API + App-oriented Python Code App-oriented API-oriented
Supported LLMs Rich Variety Rich Variety Rich Variety OpenAI-only
RAG Engine
Agent
Workflow
Observability
Enterprise Features (SSO/Access control)
Local Deployment

Using Dify

  • Cloud
    We host a Dify Cloud service for anyone to try with zero setup. It provides all the capabilities of the self-deployed version, and includes 200 free GPT-4 calls in the sandbox plan.

  • Self-hosting Dify Community Edition
    Quickly get Dify running in your environment with this starter guide. Use our documentation for further references and more in-depth instructions.

  • Dify for enterprise / organizations
    We provide additional enterprise-centric features. Log your questions for us through this chatbot or send us an email to discuss enterprise needs.

    For startups and small businesses using AWS, check out Dify Premium on AWS Marketplace and deploy it to your own AWS VPC with one-click. It's an affordable AMI offering with the option to create apps with custom logo and branding.

Staying ahead

Star Dify on GitHub and be instantly notified of new releases.

star-us

Quick start

Before installing Dify, make sure your machine meets the following minimum system requirements:

  • CPU >= 2 Core
  • RAM >= 4GB

The easiest way to start the Dify server is to run our docker-compose.yml file. Before running the installation command, make sure that Docker and Docker Compose are installed on your machine:

cd docker
cp .env.example .env
docker compose up -d

After running, you can access the Dify dashboard in your browser at http://localhost/install and start the initialization process.

If you'd like to contribute to Dify or do additional development, refer to our guide to deploying from source code

Next steps

If you need to customize the configuration, please refer to the comments in our .env.example file and update the corresponding values in your .env file. Additionally, you might need to make adjustments to the docker-compose.yaml file itself, such as changing image versions, port mappings, or volume mounts, based on your specific deployment environment and requirements. After making any changes, please re-run docker-compose up -d. You can find the full list of available environment variables here.

If you'd like to configure a highly-available setup, there are community-contributed Helm Charts and YAML files which allow Dify to be deployed on Kubernetes.

Using Terraform for Deployment

Azure Global

Deploy Dify to Azure with a single click using terraform.

Contributing

For those who'd like to contribute code, see our Contribution Guide. At the same time, please consider supporting Dify by sharing it on social media and at events and conferences.

We are looking for contributors to help with translating Dify to languages other than Mandarin or English. If you are interested in helping, please see the i18n README for more information, and leave us a comment in the global-users channel of our Discord Community Server.

Contributors

Community & contact

  • Github Discussion. Best for: sharing feedback and asking questions.
  • GitHub Issues. Best for: bugs you encounter using Dify.AI, and feature proposals. See our Contribution Guide.
  • Discord. Best for: sharing your applications and hanging out with the community.
  • Twitter. Best for: sharing your applications and hanging out with the community.

Star history

Star History Chart

Security disclosure

To protect your privacy, please avoid posting security issues on GitHub. Instead, send your questions to [email protected] and we will provide you with a more detailed answer.

License

This repository is available under the Dify Open Source License, which is essentially Apache 2.0 with a few additional restrictions.

dify's People

Contributors

benjaminx avatar bowenliang123 avatar charli117 avatar chazzhou avatar crazywoola avatar dependabot[bot] avatar garfielddai avatar guchenhe avatar hjlarry avatar iamjoel avatar johnjyong avatar junice avatar jzongkvo avatar kurokobo avatar laipz8200 avatar leilei-jiang avatar leslie2046 avatar matriq avatar orangeclk avatar panmuse avatar richards199999 avatar sinomoe avatar soulteary avatar takatost avatar weaxs avatar yeuoly avatar yixiao0 avatar zhouhaojiang avatar zuzoovn avatar zxhlyh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dify's Issues

docker compose -f docker-compose.yaml up -d出现问题

我按照官网要求,直接run官方的docker-compose.yaml。所有镜像下载后,启动容器时出现以下错误:
[+] Running 0/0
⠋ Container -weaviate-1 Creating 0.0s
⠋ Container -db-1 Creating 0.0s
⠋ Container -web-1 Creating 0.0s
⠋ Container -redis-1 Creating 0.0s
Error response from daemon: Invalid container name (-weaviate-1), only [a-zA-Z0-9][a-zA-Z0-9_.-] are allowed
为什么我的容器命名不规范(明明什么也没动),是yaml文件里的问题,还是我的问题,感谢各位能够给我解答

期望回答内容尽可能是数据集

我上传了数据集,但是回答内容不能说错,但是能够直接从数据集中返回内容的话,回答的可信度会很高。如果要达到此效果,需要设置什么或者其他什么操作。

向量化后的段落是否可以支持二次编辑

也可以考虑在拆分后的每个段落下面支持一个附加字段,附加字段不参与向量化和检索,但附加字段会合并到上下文里参与问答。
导入的时候支持QA对,对Q进行嵌入,A作为附加字段。

这样做的好处:

  • 减少向量化片段中过多干扰描述影响召回率,同时又不影响组装后上下文的内容详实性。
  • 降低embedding的成本
  • 增强复杂问答场景下内容维护的便利性

key 认证提示无效的key

您好, 我的open ai key 在dify 上验证提示无效, 但这个key是正常的, 请问这个是什么问题呢?

pdf处理状态错误

image

导入pdf后,如图,处理状态显示为错误,我该如何进行下一步工作?

无法添加 Azure OpenAI 信息

网页版 https://cloud.dify.ai/ 中,设置 - 模型供应商 - Azure OpenAI Service 里按要求填完信息后,点 保存 显示保存成功,但界面仍是未添加服务的状态,app 里调用模型时仍然走的免费的 托管 OpenAI 的部分。

Development Environment Configuration

我按照你们的指南进行配置,但是遇到了一些问题

  1. 你们的指南中没有提到如何配置 web 的 .env.local 文件
# web/.env.local
NEXT_PUBLIC_DEPLOY_ENV=DEVELOPMENT
NEXT_PUBLIC_EDITION=SELF_HOSTED
NEXT_PUBLIC_API_PREFIX=http://127.0.0.1:5001/console/api
NEXT_PUBLIC_PUBLIC_API_PREFIX=http://127.0.0.1:5001/api
  1. docker/volumes/db/scripts 似乎有权限问题
    ls: can't open '/docker-entrypoint-initdb.d/': Permission denied

  2. 没有告诉用户需要在 http://localhost:3000/install 进行管理员配置

  3. CHECK_UPDATE_URL 需要访问你们的在线服务,在**访问有些问题

启动的时候报错:flask run --host 0.0.0.0 --port=5001 --debug

Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/bin/flask", line 8, in
sys.exit(main())
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/flask/cli.py", line 1063, in main
cli.main()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/click/decorators.py", line 84, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/flask/cli.py", line 911, in run_command
raise e from None
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/flask/cli.py", line 897, in run_command
app = info.load_app()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/flask/cli.py", line 312, in load_app
app = locate_app(import_name, None, raise_if_not_found=False)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/flask/cli.py", line 218, in locate_app
import(module_name)
File "/Users/jetty/workspace/dify/api/app.py", line 22, in
from events import event_handlers
File "/Users/jetty/workspace/dify/api/events/event_handlers/init.py", line 3, in
from .create_provider_when_tenant_created import handle
File "/Users/jetty/workspace/dify/api/events/event_handlers/create_provider_when_tenant_created.py", line 2, in
from services.provider_service import ProviderService
File "/Users/jetty/workspace/dify/api/services/provider_service.py", line 5, in
from core.llm.provider.llm_provider_service import LLMProviderService
File "/Users/jetty/workspace/dify/api/core/llm/provider/llm_provider_service.py", line 3, in
from core.llm.provider.anthropic_provider import AnthropicProvider
File "/Users/jetty/workspace/dify/api/core/llm/provider/anthropic_provider.py", line 3, in
from core.llm.provider.base import BaseProvider
File "/Users/jetty/workspace/dify/api/core/llm/provider/base.py", line 13, in
class BaseProvider(ABC):
File "/Users/jetty/workspace/dify/api/core/llm/provider/base.py", line 76, in BaseProvider
def get_provider_configs(self, obfuscated: bool = False) -> Union[str | dict]:
TypeError: unsupported operand type(s) for |: 'type' and 'type'

终端运行 docker -compose up -d报错

image rt,对docker的了解只是入门。按照步骤做了,但是报了这个错。查了一下,是说运行的层数过多导致,那我把yml的文件里的几行命令用“ && “合并可行吗?大佬捞一捞🥹

【需求】文本生成型应用增加变量的信息说明内容维护

解决谁的问题:文本生成型应用的新用户
痛点:对于一个新用户来说,应用的概览介绍信息对于某些复杂场景下的应用——即变量自由度较高,对参数内容、格式有一定要求的应用来说,并不足以说明应用的使用方法,应该在应用提供服务时,提供精确到变量维度的文本说明信息配置功能。
需求内容:
以图片为例
image

OpenAi Key输入后报错

image
肯定是有效得,本地代码 API调用都是通得

{"result": "error", "error": "Invalid response object from API: '{"object":"error","message":"Only /v1/chat/completions && /v1/embeddings allowed now , your path {/moderations}","code":40301}' (HTTP response code was 403)"}

Feature Request: Application marketplace

Since the applications is prompt based, is it possible to have a marketplace where Dify Cloud users can share applications(and even datasets if they choose to opensource them)?

如何增加成员?

在设置-成员中点击邀请,输入邮箱,对方无法收到邮件。

向量检索如何自行定义、优化改进?

想看到更多关于本项目的向量检索的思路的介绍

我想找到在哪可以修改Retrievers的逻辑以优化跨文档检索时召回的Node的质量

举粗略的例子,用户提问 昨日有什么餐点可以选择? 我希望能在检索时加入2023/05/16 这个文本,而不是在用户提问里。

举粗略的例子2,用户提问 游泳池的收费标准? 我希望检索后删掉关于VIP收费标准的Node再到llm

以上逻辑我可以自行实现,希望大佬指条明路和思路,谢谢

安装失败

使用Docker Compose 启动完成后,发现一个容器一直起不来,打开http://localhost 后一直提示502
然后看了一下容器如下
image
然后看了一下logs如下
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.