Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,6 @@ PLUGIN_RUNTIME_MAX_BUFFER_SIZE=5242880
DIFY_BACKWARDS_INVOCATION_WRITE_TIMEOUT=5000
# dify backwards invocation read timeout in milliseconds
DIFY_BACKWARDS_INVOCATION_READ_TIMEOUT=240000

PIP_MIRROR_URL=
PIP_EXTRA_INDEX_URL=
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,28 @@ Daemon uses `uv` to manage the dependencies of plugins, before you start the dae
#### Interpreter
There is a possibility that you have multiple python versions installed on your machine, a variable `PYTHON_INTERPRETER_PATH` is provided to specify the python interpreter path for you.

#### Speeding up Python dependency installation (uv/pip)
You can speed up plugin dependency installation by configuring Python package indexes via environment variables (set them in your shell or `.env`). The daemon reads these into its config on startup.

Supported variables
- PIP_MIRROR_URL: Primary index for both uv sync and uv pip install
- PIP_EXTRA_INDEX_URL: One or more extra indexes (comma or space separated)

Behavior
- Applies uniformly to both dependency styles:
- pyproject.toml (using `uv sync`)
- requirements.txt (using `uv pip install`)
- Trusted hosts are derived automatically from the configured URLs.

Examples
```bash
# Use the official PyPI index
PIP_MIRROR_URL=https://pypi.org/simple

# Add multiple mirrors (comma or space separated)
PIP_EXTRA_INDEX_URL="https://my.mirror/simple, https://another.mirror/simple"
```

## Deployment

Currently, the daemon only supports Linux and MacOS, lots of adaptions are needed for Windows, feel free to contribute if you need it.
Expand Down
2 changes: 2 additions & 0 deletions internal/core/local_runtime/dependency_installation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ func TestPreparePipArgs(t *testing.T) {
"pip",
"install",
"-i", "https://pypi.tuna.tsinghua.edu.cn/simple",
"--trusted-host", "pypi.tuna.tsinghua.edu.cn",
"-r", "requirements.txt",
}, args)
})
Expand Down Expand Up @@ -229,6 +230,7 @@ func TestPreparePipArgs(t *testing.T) {
"pip",
"install",
"-i", "https://pypi.tuna.tsinghua.edu.cn/simple",
"--trusted-host", "pypi.tuna.tsinghua.edu.cn",
"-r", "requirements.txt",
"-vvv",
"--no-cache",
Expand Down
Loading
Loading