Skip to main content
Version: 0.8.x [Latest Beta]

Authentication and licensing

Most real deployments use licensed models exported from the DENKweit Vision AI Hub. To run them, you need a personal access token and a suitable license source.

Step 1: Create a personal access token

  1. Open the Integration Page.
  2. Create a service user or select an existing one.
  3. Generate a PAT for that service user.
  4. Store the PAT securely. It will only be shown once.

Treat the PAT like a password.

Managing Service Users on the Vision AI Hub

Adding a new Service User

Creating a Personal Access Token (PAT) for a Service User

Step 2: Choose a license mode

HubLicenseSource

Use this when the target system can stay online.

from denkflow import HubLicenseSource

license_source = HubLicenseSource.from_pat(
"YOUR-PAT",
license_id="YOUR-LICENSE-ID",
)

You can also let Pipeline.from_denkflow(...) build this implicitly by passing pat=.

from denkflow import Pipeline

pipeline = Pipeline.from_denkflow("model.denkflow", pat="YOUR-PAT")

OneTimeLicenseSource

Use this when the deployment must continue working offline after initial activation.

from denkflow import HubLicenseSource

hub_source = HubLicenseSource.from_pat(
"YOUR-PAT",
license_id="YOUR-LICENSE-ID",
)
license_source = hub_source.to_one_time_license_source()

Notes:

  • Offline activation must be enabled for your license.
  • The first activation needs online connectivity.
  • The persisted offline state is stored in DENKFLOW_DATA_DIRECTORY.
  • If you add new licensed models later, refresh the license while online:
license_source.refresh()

Step 3: Keep licensing stable in production

For reliable deployments:

  1. Keep SDK persistent data on a volume that survives restarts. In Docker, the usual approach is to mount a host directory onto the default data path (for Linux as root, /root/.config/denkflow — the same as $HOME/.config/denkflow). You only need to set DENKFLOW_DATA_DIRECTORY if you choose a non-default path inside the container.
  2. Keep /etc/machine-id stable in Docker deployments.
  3. Reuse the same persistent volume across restarts.

Which option should you use?

Use HubLicenseSource when:

  • the system stays online
  • you want the simplest rollout

Use OneTimeLicenseSource when:

  • the system must run offline after first activation
  • you can guarantee stable persistent storage

Pitfalls

  • Using a PAT without access to the required license.
  • Persistent state is not actually persistent: the SDK data directory (default or whatever DENKFLOW_DATA_DIRECTORY points to) must be writable and survive restarts — in Docker, typically by mounting a host volume at /root/.config/denkflow (or at your custom path if you set DENKFLOW_DATA_DIRECTORY).
  • The machine identity changes between restarts: keep /etc/machine-id stable, especially in Docker deployments.
  • Adding new licensed models while offline without refreshing the offline license state first.