Upgrading to Pro SDK
Pre-requisites
This page assumes that you have been granted access to Argmax Pro SDK and obtained the following credentials from Argmax:
SECRET_API_TOKEN
to provision SDK accessAPI_KEY
to unlock the Pro features
If you have not yet been granted access, please see here.
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. For more info on private SwiftPM registries, see here.
Step 0: Remove Open-source
Please skip and advance to the next step unless upgrading from Argmax Open-source SDK.
Open-source forks not supported
After upgrading to Argmax Pro SDK, open-source dependencies that you removed will automatically reappear, pinned to a specific release version. If you maintain and/or depend on a fork or an older release, please get in touch with the Argmax team. Argmax Pro SDK is not guaranteed to work with other versions of Argmax Open-source SDK at this time.
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 is:
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 is:
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.1.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:
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:
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.
Minimum required server communication
- In order to provision a new license, each end user device must successfuly communicate with Argmax's License Server during first use.
- In order to maintain a valid license, each end user device must successfuly validate with Argmax's License Server at least once per 30 days.
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)
ArgmaxSDK
initialization must come BEFORE WhisperKitPro
initialization.
If upgrading from open-source, replace all import WhisperKit
with import Argmax
Node Package Manager (npm)
Argmax Pro SDK can also be integrated through npm for non-native integrations, e.g. an Electron app.
Documentation coming soon. Please reach out to pro-sdk-support@argmaxinc.com for early access.
Local API Server
If you would like to test the latency and accuracy of Argmax SDK before investing in SDK-level integration into your application, this option is for you.
Argmax Pro Server is an on-device inference provider. Your application communicates with it just like you would with a server-side inference API except that Argmax Pro Server does not require an internet connection.
Argmax Pro Server supports the WebSocket protocol for Real-time Transcription.
Documentation coming soon. Please reach out to pro-sdk-support@argmaxinc.com for early access.