Skip to main content
Version: 0.5.x [Latest Alpha]

Authentication and Licensing

Accessing models from the Vision AI Hub requires authentication and licensing, managed via Personal Access Tokens (PATs).

Personal Access Tokens (PAT)

A PAT is required to create a LicenseSource, which verifies your permission to use specific models. PATs are always bound to a Service User and group.

Generating a PAT:

  1. Go to the Integration Page on the Vision AI Hub.
  2. Create a service user (or use an existing one).
  3. Generate a new PAT for this user, granting it access to the necessary licenses.
  4. Copy the generated PAT securely. Treat it 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

License Sources (HubLicenseSource vs OneTimeLicenseSource)

You need to create a LicenseSource object using your PAT. Choose the type based on your environment's internet connectivity:

1. HubLicenseSource:

  • The standard licensing method.
  • Requires continuous internet access for license checks during pipeline initialization and potentially during runtime.
  • Create using:
from denkflow import HubLicenseSource
license_source = HubLicenseSource.from_pat("YOUR-PAT-TOKEN", license_id="YOUR-LICENSE-ID")

or create pipeline from a .denkflow file:

from denkflow import Pipeline
pipeline = Pipeline.from_denkflow(model_file, pat=pat)

2. OneTimeLicenseSource:

  • Designed for environments with limited or no internet access after initial setup.
  • Requires activation by DENKweit for your license before first use. Please contact DENKweit support to enable this feature.
  • Needs internet connection only for the very first pipeline run to activate the license offline.
  • Subsequent runs using the same licensed models can be fully offline.
  • Internet is required again only if you add new models or change the licensed models in your pipeline. (Retraining existing licensed models on the Hub does not require reactivation).
  • The offline license state is stored in the DENKFLOW_DATA_DIRECTORY. Ensure this directory is persistent.
  • Create using:
from denkflow import HubLicenseSource
# First, create a HubLicenseSource, providing the license_id
hub_source = HubLicenseSource.from_pat("YOUR-PAT-TOKEN", license_id="YOUR-LICENSE-ID")
# Then, convert it to a OneTimeLicenseSource
license_source = hub_source.to_one_time_license_source()

# Refreshing the license (e.g., after adding new models to your license on the Hub)
# This requires an internet connection.
license_source.refresh()

or create a pipeline directly from a .denkflow file:

from denkflow import Pipeline
pipeline = Pipeline.from_denkflow(model_file, pat=pat, one_time_registration=True)
  • Refreshing Licenses: If you add new models to your existing license on the Vision AI Hub, you need to call the specific refresh method on your OneTimeLicenseSource object while connected to the internet. This updates the offline license state stored in DENKFLOW_DATA_DIRECTORY to include the permissions for the new models. Using a retrained version of a previously used model does not require a refresh.

  • Loading Pipelines: Use Pipeline.from_denkflow(file_name, *, license_source=..., pat=...) to load .denkflow files. You must provide either a license_source object (created as shown above) or a pat string (which internally creates a HubLicenseSource).