Encrypted Storage
All secrets are encrypted at rest using industry-standard encryption protocols
The FlexAI Secret Manager provides a secure, encrypted storage solution for managing sensitive information such as API keys, access tokens, credentials, and configuration data. All secrets are encrypted at rest and can be safely referenced in your training and inference workloads.
The Secret Manager enables you to:
Encrypted Storage
All secrets are encrypted at rest using industry-standard encryption protocols
Flexible Content Types
Store strings, tokens, or entire files as secrets for maximum flexibility
Workload Integration
Automatically inject secrets as environment variables in Training and Inference jobs
Access Control
Secure access patterns ensure secrets are only available to authorized workloads
Store access credentials for Remote Storage Connections to enable seamless Dataset uploads and Checkpoint exports:
Securely authenticate to Hugging Face to pull Models and Datasets.
Store sensitive configuration data and credentials:
Visit the Secret Manager section 🔗 of the FlexAI Console to create, update, or delete Secrets through an intuitive web interface.
Create a Secret by using the flexai secret create command, which will receive the name of the secret as its only argument. In this case we will use hf_token to store a Hugging Face Access Token.
flexai secret create hf_tokenYou will be prompted to enter the value for the secret. You can either type in the value directly or paste it. In any case, the value will not be displayed in the terminal.
flexai secret create hf_tokenSecret Value: █You can pass the value of a Secret directly from standard input (stdin) by piping in the value. This is particularly useful for automated scripts, when you want to avoid interactive prompts, or when you want to store the contents of a file as a Secret —like a Google Cloud Service Account File.
Piping in the value and using the -p/--value-stdin flag:
cat gcp-service-account.json | flexai secret create --value-stdin secret-from-sa-fileAn existing Secret can be updated by using the flexai secret update command, which will receive the name of the secret as its only argument.
Let’s update hf_token to modify the Hugging Face Access Token’s value.
flexai secret update hf_tokenYou will be prompted to enter the new value for the Secret, just like when creating it.
flexai secret update hf_tokenSecret Value: █Secrets can be passed to Workloads in different ways: some commands flags receive Secret names as their value, and others explicitly require the name of a Secret and a name to associate it with, such as the -S/--secret flag of the flexai training run and flexai training debug-ssh commands.
flexai training run test-123 \ --dataset open_web \ --repository-url https://github.com/flexaihq/nanoGPT/ \ --secret HF_TOKEN=hf_token \ --secret WANDB_API_KEY=wandb-key \ -- train.py ...flexai training debug-ssh \ --secret HF_TOKEN=hf_token_dev \ --secret SA_FILE=secret-from-sa-file \ -S DB_API_KEY=db-api-key-staging \ --repository-url https://github.com/flexaihq/nanoGPT/ \ --vscodeThe flexai inference serve command’s --hf-token-secret and --api-key-secret flags expect the name of a Secret:
flexai inference serve llm-text-inference-prod \ --hf-token-secrethf_token_prod \ --api-key-secret api-key-prod \ -- --model=mistralai/Mistral-7B-Instruct-v0.1 ...