How Dify connects to Ollama and other self-hosted models
A team that wants Dify apps and knowledge bases to run on models inside its own infrastructure is really asking for three things at once: every model call stays on infrastructure the team controls, the models have enough capacity for real users, and the people approving the setup can see where prompts and documents go. Dify reaches models through provider configuration in its console, and Ollama and OpenAI-compatible inference servers are common targets because they expose endpoints Dify can call once a base URL, model name and credentials are entered. That step is the easy part. Adding a self-hosted endpoint is not the same as adding an API key to a hosted provider, because the endpoint has its own capacity limits, its own model versions and its own logging, none of which Dify manages for you.
Planning starts with an inventory. List which apps and workflows will call which model, because a chat assistant, a document summarizer and an agent with tool access often need different models and different concurrency. Then decide where embedding models run, since knowledge base indexing and retrieval call an embedding model as well as the chat model, and a mismatch between the two can degrade search quality without any visible error. Confirm with your platform team how many concurrent requests the self-hosted endpoint can serve at acceptable latency, and test that number with your own prompts instead of relying on vendor claims. Also confirm whether Dify's current release supports the specific provider type and endpoint format you plan to use, because provider support changes between releases.
The data path matters as much as the model choice. Prompts, retrieved document chunks, workflow variables and model outputs all pass between Dify's api and worker services and the model endpoint, and any app that falls back to a hosted provider sends those same payloads outside your network. Write down which apps are allowed to call hosted models, which must stay on local models, and who can change a provider setting in the workspace. Then check the outbound path with your network team, including the SSRF proxy that Dify uses for outbound requests, so that the self-hosted endpoint is reachable and nothing else is. Ask your implementation partner to show these settings in a test workspace before any production data is loaded.
Which Dify components touch a self-hosted model
A request from a Dify app to a local model passes through the console settings, the api and worker services, the plugin daemon and, for code or outbound calls, the sandbox and SSRF proxy. Each hop can change where the request goes and whether it is allowed to reach a private address.
Model provider settings in the console
Administrators register the model endpoint, such as an Ollama server or an OpenAI-compatible server, and its model names in the Dify console. These settings decide which provider each app can select and which base address receives the prompt. Check the provider entry for the exact base URL, model type and context length fields in your version's docs, because field names differ between provider plugins.
Environment variable referenceThe api and worker services
The api service receives app requests from the web console and API callers, and the worker service runs background jobs such as document indexing. Both call the model provider when an app or knowledge base needs inference or embeddings. Confirm which of these paths your apps use, since a local model that serves chat but not embeddings will still break knowledge base indexing.
- Minimum host CPU
- 2 CPU cores
The plugin daemon
Model providers in current Dify releases are delivered through the plugin daemon, which loads provider plugins and forwards calls to the configured endpoint. A provider that works in one release may need its plugin updated after an upgrade. Confirm the plugin version that matches your Dify version before you rely on a local provider in production.
The code sandbox
The sandbox runs code nodes and some agent tools in an isolated container, separate from the api service. It does not normally call the model, but a workflow can pass model output into sandboxed code, so the sandbox is part of the data path. Review its network rules, and confirm in the release notes for your version how agent sandbox network isolation is applied.
The SSRF proxy and private addresses
The SSRF proxy routes outbound requests from Dify and blocks internal and private IP ranges by design. A model endpoint on a private address, such as an Ollama host on your LAN, can be refused by default, so the request fails even though the server is reachable from your network. Test the exact base URL from the api and worker containers, and confirm the proxy settings your version expects before you widen any allowlist.
SSRF proxy settingsThe model endpoint itself
Ollama or another OpenAI-compatible server receives the prompt, loads the model onto GPU or CPU, and returns tokens. Its address, port, authentication and model pull state determine whether Dify gets an answer, and its logs are a separate audit trail from Dify's own. Confirm the endpoint's authentication options, the models it has loaded, and where its logs are kept, since Dify does not store them for you.
How a request travels from a Dify app to a local or hosted model
The request starts with a user or API caller reaching the Dify web and api services inside the client's network. The api service hands workflow execution to the worker, and outbound model calls leave through the SSRF proxy, which blocks internal and private IP ranges. The diagram shows two branches: a self-hosted model endpoint on the internal network and a hosted provider API outside the trust boundary. Check which branch each app uses, because data sent to the hosted branch leaves your infrastructure.
Request path from a Dify app to self-hosted and hosted model endpoints, with the trust boundary.
Which model hosting and routing choices to make first
This table compares the main hosting and routing options for Dify with self-hosted models, with the operational cost each one carries. Read each row as a decision: when the option fits, and what your team will own afterward for patching, capacity, model lifecycle, evaluation and data handling review.
| Option | When it fits | Operational cost to plan for |
|---|---|---|
| All models self-hosted | Every app handles data that cannot leave your infrastructure, and quality targets can be met by open-weight models you can run | Your team owns GPU capacity planning, model patching and replacement, evaluation of each model against your tasks, and full data handling review for the inference path |
| Self-hosted models for sensitive apps, hosted models for others | Only some workflows touch regulated or confidential data, and the rest benefit from larger hosted models | Two provider paths to configure and monitor, a routing rule that is documented and tested, and separate data handling reviews for each hosted provider |
| Ollama on a single host | A small team needs to pull and run models quickly on one machine for internal apps or pilots | Ollama is simple to start, but you still own host patching, model versions pinned by your team, and manual capacity checks as concurrent use grows |
| OpenAI-compatible inference server | You need higher throughput, batching or a stable API surface shared by several internal tools | Server tuning, GPU driver and runtime upgrades, and confirming which chat, embedding and tool-calling features your chosen server supports for each model |
| Shared GPU host | Traffic is light, several models share one machine, and cost of idle hardware matters more than latency | Model loading contention between apps, noisy neighbor effects on response times, and a single failure point for every app that depends on it |
| Dedicated inference hosts | Latency targets, peak load or isolation requirements mean one app should not affect another | More hardware to purchase or reserve, separate patching windows, and monitoring for each host, which raises the recurring operations effort |
| Local embedding model | Knowledge base documents must stay inside your environment and the embedding model can run on available hardware | Re-embedding of all knowledge bases is needed if the embedding model changes, so pin the model and record its version alongside each index |
| Hosted embedding model | Document content is already approved for a hosted provider and retrieval quality on your corpus is the priority | Recurring usage charges from the provider, data handling review of what is sent for embedding, and a migration plan if you switch providers later |
How to configure Dify against a self-hosted model step by step
This sequence takes a team from a working Dify deployment to a tested chat model, embedding model, app and knowledge base all served from infrastructure they control. Each step closes with a check so problems surface before users depend on the setup.
Confirm the Dify deployment and prerequisites
Confirm that Dify is running with Docker Compose on a host that meets the documented minimum of 2 CPU cores and 4 GB of RAM, with Docker Compose 2.24.0 or later installed. The platform or infrastructure engineer should check that the api, worker, web and plugin daemon containers are healthy and that the console loads in a browser. Record the Dify version and the contents of the .env file, since the model endpoint settings in later steps depend on them. The step is done when the console login works and every core container reports as running. Hardware for model inference is a separate question, handled in the next step.
Stand up the model endpoint on a reachable address
Install the model server, such as Ollama, on a host that the Dify containers can reach over the internal network, and pull the chat and embedding models you plan to use. The infrastructure team should decide whether the model runs on the same host, a GPU host or a separate inference node, and confirm GPU memory is sufficient for the chosen model sizes. Bind the server to an address other than localhost, because a server listening only on the loopback interface is unreachable from inside a container. Check the endpoint by running a test request from the Dify api container to the model server's address, and confirm a model response comes back. Model server versions and hardware requirements should be confirmed against each project's own documentation.
Register the model provider in Dify
In the Dify console, open the model provider settings and add the self-hosted provider, entering the endpoint address reachable from the Dify containers and any API key the server requires. For Ollama, use its dedicated provider entry; for other servers that expose an OpenAI-compatible API, use the OpenAI-compatible option and enter the base URL that includes the version path. The platform owner should record which workspace and account created the credential, since model credentials are stored by Dify and should be managed under your secret handling policy. The check is that the provider appears as active with no validation error after saving. A failed save usually means the container cannot reach the address, which points back to the previous step.
Add chat and embedding models with their settings
Add each model the provider serves as a separate entry, selecting chat models for generation and embedding models for knowledge base indexing, and set the context length and default parameters such as temperature and maximum output tokens to match what the model server actually supports. Confirm the context window from the model server's own metadata rather than assuming a default, because a mismatch leads to truncated prompts or failed requests. Keep embedding models separate from chat models so that changing one does not force re-indexing decisions unintentionally. The check is a test prompt in the model test panel that returns a coherent response, and an embedding test that returns a vector without error.
Confirm the SSRF proxy allows the internal route
Dify routes outbound requests through an SSRF proxy that blocks internal and private IP ranges, which is a protection for the platform but can also block a model server on a private address. Review the SSRF_PROXY settings in the environment reference and the proxy configuration in the Compose deployment, then decide with the security team how the model server address is permitted, such as an explicit allowlist entry or a placement that the proxy path does not block. Do not disable the proxy to make the connection work. The check is that the test call from the Dify container still succeeds after the change, and that a request to an address outside the approved list is still blocked.
Build a test app and a knowledge base
Create one chat app that uses the self-hosted chat model, and one knowledge base that uses the self-hosted embedding model, with a small set of non-sensitive test documents. The Dify builder or platform engineer should check retrieval by asking questions whose answers exist only in those documents, and confirm the response cites the correct source. Note that the default vector store is Weaviate, and that the choice of vector store is a separate decision covered in its own topic. The check is a grounded answer in the app preview, with the retrieved passage visible, and a console log entry showing the request was served by the self-hosted provider.
Set a fallback or routing rule
Decide which requests may go to a hosted model and which must stay on the self-hosted model, then configure the app or workflow so that the choice is explicit rather than left to whichever model was selected last. Where a fallback is needed for availability, define it in a workflow with a condition node that switches providers when the primary endpoint fails, and test that failure by stopping the model server. Involve the data owner, because routing a document or prompt to a hosted provider is a data residency decision, not only a reliability one. The check is that a forced failure produces the expected fallback behavior or a clear error, and that the logs show which provider served each request.
How the setup changes on a single host, a separate GPU host or Kubernetes
In this model, Dify's Docker Compose stack and Ollama run on the same machine, so the Dify containers reach the model through a local address on the Docker network or the host. Traffic to the model never leaves the host, which keeps prompts and completions off the network, but every component shares one failure domain: a host reboot, disk fill or GPU driver fault stops the chatbots, the workflows and the model at once.
- Network path: Dify calls Ollama over an internal address on the host, so no firewall rule to a separate inference server is needed.
- Failure domain: One host carries the web tier, API, workers, PostgreSQL, Redis, the vector store and the model, so a single fault affects all of them.
- Resource contention: Model loading competes with Dify workers, database and vector indexing for memory and disk.
- Community limits: Docker Compose offers no built-in high availability, no failover for the model and no clustered vector store.
- Backups: Model weights are reproducible from the registry, but Dify's database, file storage and secrets still need scheduled backups.
Before choosing this model, confirm with your Dify and Ollama references which Compose version and host sizing your models require, and how your team will restore the stack after a host failure.
Here Dify's Compose stack runs on a general application host and Ollama or another OpenAI-compatible endpoint runs on a separate GPU host on the internal network. The model's address becomes a network dependency that must be allowed through the firewall and reachable from the Dify containers, which also means traffic between the two hosts should be encrypted and restricted to the Dify host. The GPU host can be scaled, patched or replaced without touching the application tier.
- Network path: Dify reaches the endpoint over a private address; the GPU host should accept connections only from the Dify host on the model port.
- Failure domain: The application and the model fail independently, but a model outage still stops every AI feature, so the application should show a clear error rather than hang.
- Outbound controls: Dify's SSRF proxy blocks internal and private address ranges by default, so confirm how the model endpoint is reached and whether that proxy path needs an explicit exception.
- Capacity: GPU memory limits how many models stay loaded and how many requests run in parallel, and these limits belong to the GPU host, not to Dify.
- Community limits: Compose does not replicate the model endpoint or provide automatic failover to a second GPU host.
Confirm with your network and security teams how the endpoint is authenticated, how traffic is encrypted between hosts, and which Dify version and environment settings allow the private endpoint to be called.
Dify Enterprise can run on Kubernetes, where the application services, the workers and the data services are scaled and restarted by the cluster, and inference nodes are usually managed as a separate pool. The vendor's resources checklist lists Kubernetes 1.24 or later, Helm 3.14 or later, PostgreSQL 14 or later, Redis 6 or later, a Qdrant vector database and S3-compatible or cloud object storage. Model traffic then crosses cluster boundaries, so network policies, service addresses and node placement become design decisions.
- Network path: Dify pods reach model endpoints through cluster egress, which needs explicit policies and, often, a dedicated node pool or service for inference.
- Failure domain: Workers, API and data stores can be spread across nodes, while inference nodes fail on their own schedule.
- Sizing reference: The vendor's production example uses six worker nodes with 8 CPUs and 32 GB of RAM each and a three-node Qdrant cluster, which is a reference point, not a sizing for your workload.
- Community comparison: The Community Compose stack cannot provide this high availability, SSO or multi-workspace management.
- Ownership: Your platform team owns the cluster, GPU scheduling and upgrades, so the operating burden is higher than on Compose.
Confirm with the vendor whether the inference pool is in scope for the Enterprise package, which provider settings are supported for externally managed endpoints, and how Enterprise licensing applies before you commit to this model.
On an air-gapped network, hosted model providers are unreachable by design, so every model, embedding and reranking call must terminate on infrastructure inside the boundary. Dify's container images, plugins and any model files must be brought in through an approved transfer process before the stack can run. The security benefit is that no prompt or document leaves the enclosure, but the team takes on the work of updating images, models and plugins without direct internet access.
- Network path: Only internal endpoints are reachable; any setting that points at a public provider will fail and should be removed from configuration.
- Supply chain: Container images, plugins and model files need a controlled import path with checksums and an approval record.
- Failure domain: No external fallback exists, so a local model outage has no hosted backup to route to.
- Upgrades: Each release's upgrade guide and new environment variables must be reviewed and transferred before updating, which slows the monthly release pace.
- Community limits: Verify whether the Community edition's features and licensing fit your classification and procurement rules.
Before committing, confirm with the vendor which artifacts are needed for an offline install, how plugins are installed without internet access, and how your assessor expects evidence of the transfer process to be recorded.
What drives the effort and cost of self-hosted model work
This table lists the main drivers of effort and cost when Dify runs against self-hosted models such as Ollama, with one-time and recurring costs marked for each. Use it to see which decisions move the quote most, then ask for each driver to be priced separately in the written scope. The main takeaway is that model count, concurrency and knowledge base volume usually matter more than the Dify install itself.
| Driver | Why it changes effort or cost | How to keep it down | One-time or recurring |
|---|---|---|---|
| Number and type of models | Each chat, embedding and reranking model needs its own provider setup, parameter tuning and evaluation against real prompts | Limit the first release to one chat model and one embedding model, then add others on evidence | One-time for setup, recurring when models are swapped or updated |
| GPU capacity and concurrency | Model size and expected simultaneous users set the hardware needed, and under-sizing shows up as slow or queued answers | Measure peak concurrent requests in a pilot and size from that, not from user headcount | Hardware is recurring; sizing study is one-time |
| Knowledge base volume | Embedding every document consumes compute and time, and large corpora make re-indexing after model changes expensive | Start with a bounded document set, clean sources first, and confirm whether embedding runs on local or hosted capacity | One-time for initial indexing, recurring for new content |
| Number of apps and routing rules | Each app needs prompts, workflow logic and rules that choose local or hosted models, and each rule adds test cases | Reuse one workflow pattern across apps and document the routing criteria once | One-time build, recurring review of rules |
| Data residency and classification review | Deciding which data may reach a hosted model requires classification, legal input and evidence that local-only paths hold | Classify data sources before build and keep local-only models for restricted content | One-time for review, recurring when data categories change |
| Identity and logging integration | Connecting sign-in and audit logs to existing systems adds configuration and testing; Community edition sign-in options differ from Enterprise SSO | Confirm required sign-in and log destinations early and check edition support in the written scope | One-time integration, recurring log review |
| Number of environments | Each environment needs its own model endpoints, secrets, data subsets and upgrade testing | Keep development on smaller models and shared test data, and promote configurations by export | One-time per environment, recurring patching and upgrades |
| Model and Dify upgrades | Dify minor releases arrive roughly monthly, and model updates can change output quality, so regression checks repeat | Keep a fixed evaluation set and a backup before every upgrade, as the Dify upgrade guidance advises | Recurring |
How to test that self-hosted models work and fail safely
Test the self-hosted model path in layers, starting with the cheapest check and ending with the failure cases, before any business app is pointed at it. The first layer is connectivity from the Dify containers, not from your laptop. The api and worker containers are the ones that call the model endpoint, so run the check from inside them (for example, with docker compose exec against the api service and a basic HTTP request to the Ollama or OpenAI-compatible base URL). Confirm the Docker network path, DNS name and port, and that the endpoint is reachable from the same subnet the Dify containers use. Then register the model in the Dify model provider settings, confirm it appears in the model list, and run one short completion and one structured output call. Record the model name, version tag and context length the endpoint reports, because these values drive later prompt limits.
The second layer is retrieval. Upload one small document with a known sentence, index it in a test knowledge base using the embedding model you plan to use, and ask a question whose answer appears only in that sentence. A failed answer usually points to the embedding model, chunk settings or the vector store, so test each separately. The third layer is load. Send concurrent requests at the volume your first app will realistically produce and watch latency, time-to-first-token, timeouts and GPU memory on the host. Confirm that timeouts surface as errors in the Dify logs instead of hanging workflow runs. The fourth layer is failure. Stop the Ollama service and run the same app. The app should return a clear, logged error, or switch only to a fallback model that your security and data owners have approved in writing. It must not silently call a hosted provider that was never approved for that data.
Finally, prove that prompts and documents stay on the approved path. Check egress logs from the host, the firewall or the cloud network controls for the period of the tests, and confirm that no traffic from the Dify containers reaches public model API hostnames. Dify's outbound requests can also be routed through the SSRF proxy, so confirm which proxy settings are active and what the proxy logs record. Compare the list of enabled model providers in the console with the approved list, and remove any hosted provider credential that is not approved, since a stored key is an easy path to accidental use. Ask your security team which egress evidence they will accept for the assessment, and keep the test output, configuration snapshot and log extracts together as a dated record.
How to protect model credentials, data and network paths
Model credentials, provider settings and network paths decide what a self-hosted Dify can reach and who can change it. The cards below cover the controls to set before the first model is connected, and each one points to the check that proves it works.
Model credential storage and rotation
Provider API keys for hosted models are stored inside Dify's database, so they are only as protected as the database, its backups and the admin accounts that can read them. Confirm where Dify keeps these values in your version, who can view them after they are saved, and how a key is replaced without breaking live apps. Keep a written rotation step for each provider, including which apps must be retested after the swap. Export files do not carry third-party API keys, so rotation must be repeated on any environment that receives an imported app.
App management docsLimiting who can change providers
Adding or editing a model provider changes what every app in the workspace can call, and it can redirect traffic to a different endpoint. Restrict provider configuration to a small named group and keep builders in roles that can use models without editing them. Check the role model in your edition, since Community is limited to a single workspace and Enterprise adds multi-workspace management. Review the provider list after each onboarding wave to catch unexpected endpoints.
SECRET_KEY handling
The SECRET_KEY value signs session cookies and JWTs and encrypts OAuth credentials, so the same value must follow the deployment across restores. Changing it after go-live logs out every user and can make stored credentials unreadable, so generate it once, store it in your secrets manager and record it in the restore runbook. Check that the value in .env is not committed to source control and that copies in backups are protected the same way as the database.
Restricting the model endpoint to the Dify network
An Ollama server or other OpenAI-compatible endpoint should accept calls only from the Dify api and worker hosts, not from user workstations or the wider network. Place it on a segment reachable from the Dify network alone, and require authentication at a reverse proxy or gateway in front of it, because many local model servers do not enforce access control by default. Confirm the exact authentication options for your chosen server, as they vary by product and version.
Controlling egress to hosted providers
Hosted model providers should be reachable only from the Dify components that need them, and only for the providers your approval process has cleared. Route outbound calls through a proxy or firewall allow list that names each approved provider domain. Dify's SSRF_PROXY settings send outbound requests through a proxy that blocks internal and private IP ranges, so confirm that your model endpoints on private addresses still work through that path before you rely on it. Document any exception with an owner and a review date.
Logging model calls
Model calls carry prompts, retrieved knowledge and user input, so they are the record you need when a data exposure or misuse question arises. Decide which fields you keep, such as app, provider, model, requesting account and timestamp, and where those logs are stored and for how long. Confirm which call details Dify records in its monitoring features and which must come from your gateway or proxy logs. Restrict log access the same way as the data itself.
What to monitor, document and update after go-live
The first thing to keep current after launch is a model inventory. For each model in use, record the model name and version, where it runs (for example, an Ollama host in your data center or an OpenAI-compatible endpoint in a specific region), which Dify apps and workflows call it, and the highest data classification of the content those apps process. Without this record, a model swap or a host rebuild can quietly change what data reaches which infrastructure, and an auditor or security reviewer will ask for exactly this list. Confirm with your compliance team which classification labels apply, and keep the inventory in a system of record they can review, not only in a wiki page that the platform team maintains alone.
GPU and memory monitoring needs alert thresholds that your team sets from its own load tests and service objectives, not from vendor defaults. Watch GPU memory, utilization, queue depth and response latency on each model host, and watch the Dify api and worker containers for memory growth. Pay attention to model replacement: when a model is swapped, re-run your evaluation set (answer quality, refusal behavior, output format and tool calls) before the new version serves production traffic, and record the result alongside the inventory entry. Also review each new Dify release on the Dify releases page before upgrading, because upgrades can change provider settings and new .env.example variables, and confirm your model provider configuration still points where the inventory says it does.
Back up Dify configuration on a schedule and before every upgrade. The Dify app export covers app configuration, workflow nodes, model parameters, prompts and knowledge base connections, but it does not include third-party API keys, knowledge base content or usage logs. Your backup plan therefore has to cover the metadata database, object storage, the vector store, the .env file with its SECRET_KEY, and the credentials for each model endpoint, each stored and restored through its own process. Test a restore into a separate environment, and confirm that knowledge bases can be rebuilt from source documents if the vector store is lost, since that work is not covered by the app export.
Questions teams ask before running Dify on their own models
Does the Dify Community edition support Ollama and OpenAI-compatible endpoints?
Confirm this in the current Dify documentation for your target version before you plan, because model provider support changes between releases. Dify is built to connect to many model providers, and self-hosted runtimes such as Ollama or any endpoint that speaks the OpenAI API format are usually added through the model provider settings in the console. Check three things: that the provider or endpoint type is listed for your version, which model types it supports (chat, embedding, rerank), and whether the self-hosted Community edition exposes the same settings as the hosted service. Test each model with a real prompt from your use case before you commit to it.
How long does it take to run Dify against our own models?
The duration depends on how many models you connect, how much GPU capacity you already have, whether your identity, network and storage access is ready, and how many apps and knowledge bases you need at go-live. A single-server proof of concept with one chat model and one embedding model is usually much shorter than a multi-team rollout with routing rules, access controls and backups. Ask any partner for a written timeline built from your scope, and ask which steps depend on your infrastructure team, such as provisioning hardware, opening network paths or approving data handling.
What does our team need to provide for a self-hosted model setup?
Plan to supply four things. First, access to the infrastructure where Dify and the model runtime will run, including cloud accounts or data center hosts, network paths and DNS. Second, a decision on which models serve which purpose, with named owners for each. Third, data owners who can confirm what content may reach a model, which knowledge bases are in scope and who approves them. Fourth, a test set of realistic questions, documents and expected answers so that model quality and routing can be measured rather than assumed. Missing any of these usually moves the schedule more than the installation itself.
Can our internal team deploy Dify and its models without a partner?
Often yes, if the team already runs Docker or Kubernetes, manages GPU hosts and can operate PostgreSQL, Redis and object storage. The Community edition runs anywhere Docker runs, and the Docker Compose stack requires at least 2 CPU cores, 4 GB of RAM and Docker Compose 2.24.0 or later for the base install. The harder work is usually the surrounding controls: SSO, secret handling, model credential management, backups, upgrades and evidence for your security reviews. Assess those gaps honestly, then decide which parts your team owns and which parts a fixed-scope engagement would cover.
How do we estimate the GPU capacity our self-hosted models need?
Estimate from the model size and quantization you choose, the number of concurrent users and requests, the context length your prompts and retrieved documents need, and the latency your users will accept. Run each candidate model on the hardware you plan to use and measure tokens per second, memory use and response time under a load that resembles production. Ask your hardware vendor or runtime documentation for memory requirements per model, and confirm embedding and rerank models separately, since they add load to the same hosts. No fixed GPU count can be given without these measurements.
How do we check that data stays in our infrastructure?
Map every data path before go-live: user prompts, retrieved document chunks, uploaded files, logs, the metadata database, the vector store and object storage. Confirm that self-hosted models run inside your network, and check the outbound settings in Dify, including the SSRF proxy configuration and any hosted provider that stays enabled. Then verify with traffic tests from the running system rather than relying on configuration alone. Keep the results as evidence for your data protection and security reviews. Note that a partner can prepare these controls and evidence, but independent auditors issue any attestation or certification.
What does a fixed-scope DeployOpen engagement cover for this setup?
Most DeployOpen engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts. For a self-hosted model setup, that scope typically needs to name the target infrastructure, the Dify edition and version, the model runtimes and endpoints to connect, the routing and access rules, the backup approach and the acceptance tests. DeployOpen does not publish a price list, so ask for a quote built from that written scope, and confirm what is excluded, such as GPU hardware purchases, model licensing and ongoing support.
How DeployOpen scopes, builds and hands over self-hosted model setups for Dify
DeployOpen treats the model layer as part of the Dify deployment, not an afterthought. We agree the provider list, hardware, routing rules and data handling in writing first, then build and test the connection to models running inside your own infrastructure, and hand over documentation your platform and compliance teams can review.
How we scope
- Inventory which models run locally, such as Ollama or another OpenAI-compatible endpoint, and which stay on hosted providers.
- Confirm GPU capacity, memory and hosting location against the models and concurrency your apps need.
- Record in the written scope which data may leave your network, and which routing rules and fallbacks are in or out.
How we build
- Configure each model provider in Dify, storing API keys and endpoint credentials through the platform rather than in app code.
- Set up routing between local and hosted models, then test each app's behavior when the local endpoint is slow or unavailable.
- Verify outbound traffic from the sandbox and SSRF proxy so model calls reach only the endpoints you approved.
How we hand over
- Document each model provider, its hosting location, its owner and the data classes it may receive.
- Provide test results, configuration records and the exported YAML DSL files for your apps, excluding third-party API keys.
- Walk your platform and security teams through the setup so they can review it against your own policies.
How we support
- Support is available as a retainer for model endpoint changes, new providers and Dify upgrades, which follow the release guide for each version.
- Re-test routing and data handling after each model swap, GPU change or Dify upgrade that touches provider settings.
- Ask any provider to confirm its own hosting, logging and retention terms, since DeployOpen cannot verify those on its behalf.

