Installation
Installing the Qwak SDK
In this quickstart guide, you'll learn how to deploy your first ML model on JFrog ML within minutes.
Note: JFrog ML supports Python versions <=3.11.x, please make sure to install it only with the matching Python versions.
- Create a new virtual environment using your preferred Python framework, such as virtualenv, poetry or conda.
- Install the Qwak SDK in your virtual environment with the following command:
pip install qwak-sdk
poetry add qwak-sdk
This will install the Qwak SDK and CLI client, which you'll use to interact with the JFrog ML platform.
Mac M1 Users
If you are installing the Python SDK on a Mac with an M1 chip, do not install Rosetta. The SDK is compatible with the native M1 architecture.
Configuring the Qwak SDK
The first step in configuring your Qwak authentication is through a personal API key, and you have two options available:
1. Via Qwak CLI
Log in to JFrog ML and copy your API key from the settings page.
Open the terminal and type in the following command:
qwak configure
Paste your personal API key when prompted:
Please enter your API key:
Alternatively, configure the API key a single command.
Replace <YOUR_API_KEY>
with your API key and ensure to wrap the token in double quotation marks:
qwak configure --api-key "<YOUR_API_KEY>"
After successfully configuring your API key, the below message will appear:
User succesfully configured
2. Via Environment Variable
JFrog ML also allows you to configure your session authentication key via environment variables. Please note that this is only relevant for the individual Terminal session or until the next computer restart.
To set the environment variable, use the following command:
export QWAK_API_KEY='<YOUR_API_KEY>'
The next time you run a Qwak CLI command, such as
qwak models build
, the authentication will prioritize the current environment variable over the configuration file.
The same behavior occurs when you're running Python code that calls the Qwak SDK; it will read the environment variable for authentication.
Configuring for Multiple Environments
If your organization uses JFrog ML in a multi-environment setup, such as staging
and prod
for example, you may need to specify which environment JFrog ML should use when executing commands. To achieve this, you can just use the qwak configure
command with the --environment
option, followed by the environment name you want. Example:
qwak configure --environment prod
Default Environment
When configuring your CLI without the
--environment
option, JFrog ML will define the environment assigned to the API key to bedefault
.
Specifying the Environment at Runtime
There are scenarios where you want to specify the environment when running commands, as shown in the example below:
qwak models build --model-id 'some_model' --environment 'staging' .
If your .qwak/config
file is only configured with a [default]
section, you'll encounter an error when trying to specify an environment as shown above.
To handle this scenario, update your configuration file to include sections for each environment, like this:
[default]
api_key = <YOUR_DEFAULT_ENV_API_KEY>
[staging]
api_key = <YOUR_QWAK_API_KEY_FOR_STAGING>
[prod]
api_key = <YOUR_QWAK_API_KEY_FOR_PROD>
Now, you can specify the environment when running commands, and JFrog ML will use the corresponding API key from your configuration.
To create a key for a specific environment, please select that environment by its name in your JFrog ML UI during the API key creation process.
Troubleshooting
Unrecognized qwak
Command
qwak
CommandIf your local system fails to recognize the qwak
command, ensure it's added to your system's PATH environment variable.
Read/Write Permission Issues
Should you face issues related to read/write permissions with the following error message:
Could not read user configuration from <home_path>/.qwak/config. Please make sure one has been set using qwak configure command.
Manually create the .qwak directory in your home path and rerun the configure command:
mkdir -p <home_path>/.qwak
Additional Troubleshooting
_For any other issues with installing and configuring your Qwak SDK please refer to Installation Issues or Performance Issues pages.
Updated 1 day ago