Docs
Upgrading to Pro SDK

Upgrading to Pro SDK

This document is a step-by-step guide for integrating Argmax Pro SDK. It covers first-time integration as well as upgrading from existing integrations of Argmax Open-source SDK (e.g. WhisperKit).

Swift Package Manager (SwiftPM)

This is the recommended native and secure integration using Argmax's authenticated private Swift Package Manager (SwiftPM) registry in Xcode.

Step 0: Remove Open-source

Please skip this step and advance to the next step unless you are upgrading from Argmax Open-source SDK (e.g. WhisperKit).

If your project uses Package.swift, remove the dependency there. Otherwise, navigate to Package Dependencies on the left pane in Xcode and remove the dependency there.

Step 1: Set up SDK Access

Argmax Pro SDK is delivered through Argmax's authenticated private SwiftPM registry.

You will need to execute two commands in your Terminal in order to set up your access.

First command: Set up registry

swift package-registry set --global --scope argmaxinc https://api.argmaxinc.com/v1/sdk

Upon successful completion, your ~/.swiftpm/configuration/registries.json should look like this:

{
  "authentication": {},
  "registries": {
    "argmaxinc": {
      "supportsAvailability": false,
      "url": "https://api.argmaxinc.com/v1/sdk"
    }
  },
  "version": 1
}

Second command: Authenticate

swift package-registry login https://api.argmaxinc.com/v1/sdk/login --token <SECRET_API_TOKEN>

If you observe the following please reach out to Argmax:

Error: registry login using https://api.argmaxinc.com/v1/sdk/login failed: missing or invalid authentication credentials

Upon successful completion, you should see the following message in your Terminal:

Login successful.
Credentials have been saved to the operating system's secure credential store.
Registry configuration updated.

and your ~/.swiftpm/configuration/registries.json should look like this:

{
  "authentication": {
    "api.argmaxinc.com": {
      "loginAPIPath": "/v1/sdk/login",
      "type": "token"
    }
  },
  "registries": {
    "argmaxinc": {
      "supportsAvailability": false,
      "url": "https://api.argmaxinc.com/v1/sdk"
    }
  },
  "version": 1
}

Step 2: Add Argmax Pro SDK

If you are using the Package.swift file method, please add the following to that file:

dependencies: [
    .package(id: "argmaxinc.argmax-sdk-swift", upToNextMajor: "1.7.0"),
    ...
 ],
 ...
 targets: [
    .target(
        name: "YourTargetName",
        dependencies: [
	        .product(name: "Argmax", package: "argmaxinc.argmax-sdk-swift")
	      ],
        ...

If you are using an Xcode project, go to Package Dependencies > Add Package Dependencies and enter argmaxinc.argmax-sdk-swift in the Search or Enter Package URL field on the top right corner:

SDK Screen

After updating Package.swift or Xcode project, the Argmax package should appear along with the open-source dependencies (e.g. WhisperKit and swift-transformers) similar to the screenshot below:

Dependencies

Step 3: Initialize SDK

In order to unlock Pro features, you will first need to use your API key to initialize the SDK as follows:

import Argmax
...
let myAPIKey: String = "ax_..."
await ArgmaxSDK.with(ArgmaxConfig(apiKey: myAPIKey))

Please verify that your API key starts with ax_ and has exactly 34 characters. This key will be used to communicate with https://api.argmaxinc.com in order to verify the state of your subscription and provision a license for each device. Deidentified inference performance metrics will also be communicated as per argmaxinc.com/privacy.

Step 4: Adopt Pro APIs

After initializing the Argmax Pro SDK, you will need to upgrade your code to use the Pro APIs as follows:

Before the upgrade, you may be using WhisperKit like so:

import WhisperKit
...
let pipeline = try await WhisperKit(
    model: modelName,
    downloadBase: downloadModelFolder,
    modelFolder: cliArguments.modelPath,
    tokenizerFolder: downloadTokenizerFolder,
    computeOptions: computeOptions,
    verbose: false,
    logLevel: .debug,
    prewarm: false,
    load: true,
    useBackgroundDownloadSession: false
)

OR you may be using WhisperKitConfig + WhisperKit:

import WhisperKit
...
let config = WhisperKitConfig(model: modelName)
let pipeline = try await WhisperKit(config)

To upgrade, you should adopt WhisperKitProConfig + WhisperKitPro:

import Argmax
...
let config = WhisperKitProConfig(model: modelName)
let pipeline = try await WhisperKitPro(config)