Skip to content

Authentication

The MLdebugger SDK requires authentication to the API server. This page explains how to obtain and configure authentication credentials.

Obtaining Authentication Credentials

1. Sign Up

Visit app.adansons.ai and create an account.

  1. Enter your email address and password to sign up sign_up

  2. Receive a confirmation email and verify your email address

  3. After logging in, access the tutorial at app.adansons.ai/tutorial (you are automatically redirected on first login). sign_in

2. Generate API Key

Generate an API Key from the tutorial.

URL: https://app.adansons.ai/tutorial

  1. Go to the tutorial page
  2. Click "Generate API Key"
  3. Copy the generated API Key

api_key

Handling API Key

The API Key is confidential information. Do not hard-code it or commit it to public repositories.

Setting Authentication Credentials

Authentication credentials can be configured in the following two ways.

Using environment variables is the safest and recommended method.

export MLD_API_ENDPOINT="https://api.adansons.ai"
export MLD_API_KEY="mldbg_*************"
import os

os.environ["MLD_API_ENDPOINT"] = "https://api.adansons.ai"
os.environ["MLD_API_KEY"] = "mldbg_*************"
# .env
MLD_API_ENDPOINT=https://api.adansons.ai
MLD_API_KEY=mldbg_*************
# Load in Python
from dotenv import load_dotenv
load_dotenv()

Method 2: Direct Specification in Arguments

You can also specify directly in arguments when initializing SDK classes.

from ml_debugger.training import ClassificationTracer

tracer = ClassificationTracer(
    model,
    model_name="my_model",
    version_name="v1",
    api_endpoint="https://api.adansons.ai",
    api_key="mldbg_*************",
)

Priority

Authentication credentials are applied in the following priority:

  1. Direct specification in arguments - Highest priority
  2. Environment variables - Used when arguments are not specified
# Example: Only api_key specified in argument, endpoint uses environment variable
tracer = ClassificationTracer(
    model,
    model_name="my_model",
    version_name="v1",
    api_key="mldbg_different_key",  # This value is used
    # api_endpoint uses environment variable MLD_API_ENDPOINT
)

Environment Variable List

Environment Variable Description Required
MLD_API_ENDPOINT API server URL Yes
MLD_API_KEY Authentication API Key Yes

Troubleshooting

If Authentication Errors Occur

  1. Verify API Key: Confirm the API Key is correctly copied
  2. Check environment variables: Confirm environment variables are correctly set
  3. Check network: Confirm the API server is accessible
# Check environment variables
import os
print(f"Endpoint: {os.environ.get('MLD_API_ENDPOINT', 'Not set')}")
print(f"API Key: {os.environ.get('MLD_API_KEY', 'Not set')[:10]}...")

Using in Offline Environments

In environments where API access is not possible, you can use the Tracer.export method to export data.

tracer.export("export_data.zip")

You can request evaluation by sending the exported file to the Adansons team.

Next Steps