CLI
Command-line interface for Tinfoil’s secure AI inference API
GitHub: tinfoil-cli
GitHub: tinfoil-cli
Overview
The Tinfoil CLI provides a command-line interface for making verified HTTP requests to Tinfoil enclaves and validating attestation documents. It supports all major AI inference operations including chat completions, audio transcription, and text embeddings through a unified inference orchestrator.Installation
Pre-built Binaries
Download the latest release for your OS from the Releases page.Install Script
You can install tinfoil CLI using our install script. This script automatically detects your operating system and architecture, downloads the correct binary, and installs it to/usr/local/bin.
If you receive permission errors (for example, if you’re not running as root), you may need to run the command with sudo.
Build from Source
- Ensure you have Go installed.
- Clone the repository:
- Build the binary:
Command Reference
Model Examples
Below are specific examples for each supported model. Click on any model to see its configuration and usage example.Chat Models
DeepSeek V3.1 Terminus
DeepSeek V3.1 Terminus
Alias:
terminusDeepSeek R1
DeepSeek R1
Alias:
deepseekMistral Small 3.1 24B
Mistral Small 3.1 24B
Alias:
mistralLlama 3.3 70B
Llama 3.3 70B
Alias:
llamaGPT-OSS 120B
GPT-OSS 120B
Alias:
gpt-ossQwen3 Coder 480B
Qwen3 Coder 480B
Alias:
qwen3-coderQwen 2.5 72B
Qwen 2.5 72B
Alias:
qwenAudio Models
Whisper Large V3 Turbo
Whisper Large V3 Turbo
Alias:
whisperKokoro
Kokoro
Alias:
ttsEmbedding Models
Nomic Embed Text
Nomic Embed Text
Alias:
embedChat
Thechat command lets you interact with a model by simply specifying a model name and your prompt. You need to specify the model with the -m flag.
Using the Chat Command
Basic Usage (running DeepSeek R1)
deepseek) or the full name (deepseek-r1-0528).
Response Modes
- Non-streaming (default): The complete response is returned all at once after generation is finished
- Streaming (
-sflag): Tokens are displayed in real-time as they’re generated, providing a more interactive experience
Specifying a Custom Model
You can use any model name directly. For models requiring custom enclave settings, supply the-e and -r overrides:
-e or -r for a model that isn’t in the configuration, a warning will be displayed prompting you to specify these flags.
Command Options
-m, --model: The model name to use for chat. Must be specified.-k, --api-key: The API key for authentication.-s, --stream: Stream response output (real-time token generation). Optional, defaults to false.-l, --list: List available chat models.-e, --host: The hostname of the enclave. Optional if defined in the config file.-r, --repo: The GitHub repository containing code measurements. Optional if defined in the config file.
Audio
Theaudio command allows you to transcribe audio files using Whisper models.
Basic Usage
Specifying a Custom Model
Command Options
-m, --model: The model name to use for transcription. Defaults towhisper-large-v3-turbo.-k, --api-key: The API key for authentication.-f, --file: The audio file to transcribe.-e, --host: The hostname of the enclave. Optional if defined in the config file.-r, --repo: The GitHub repository containing code measurements. Optional if defined in the config file.
TTS (Text-to-Speech)
Thetts command allows you to convert text to speech using TTS models. By default, it uses the kokoro model.
Using the TTS Command
Basic Usage
kokoro and saves the generated audio to output.mp3. You can also use the friendly name tts:
Specifying Voice and Output File
Command Options
-m, --model: The model name to use for TTS. Defaults tokokoro.-k, --api-key: The API key for authentication.--voice: Voice to use for synthesis. Defaults toaf_sky+af_bella.-o, --output: Output file path. Defaults tooutput.mp3.-e, --host: The hostname of the enclave. Optional if defined in the config file.-r, --repo: The GitHub repository containing code measurements. Optional if defined in the config file.
Embed
Theembed command allows you to generate embeddings for text inputs.
Basic Usage
With Multiple Text Inputs
You can provide multiple text inputs to get embeddings for all of them:Specifying a Custom Model
Command Options
-m, --model: The model name to use for embeddings. Defaults tonomic-embed-text.-k, --api-key: The API key for authentication.-e, --host: The hostname of the enclave. Optional if defined in the config file.-r, --repo: The GitHub repository containing code measurements. Optional if defined in the config file.
Attestation Verification
Verify Attestation
Use theattestation verify command to manually verify that an enclave is running the expected code. The output will be a series of INFO logs describing each verification step.
Sample successful output:
JSON Output
You can also record the verification to a machine-readable audit log:Certificate Audit
Thecertificate audit command verifies that a TLS certificate matches the enclave’s attestation document. This ensures the certificate you’re connecting to actually belongs to the attested enclave by comparing the certificate’s public key with the attestation’s TLS public key fingerprint.
Audit from Server
Connect to a server and audit its TLS certificate against the attestation:Audit from Certificate File
Audit a previously saved PEM-encoded certificate:Command Options
-s, --server: Server to connect to for retrieving the certificate-c, --cert: Path to a PEM encoded certificate file-v, --verbose: Enable verbose output to see detailed verification steps
- Extract the attestation document from the certificate’s DNS names (encoded in SAN field)
- Verify the attestation document’s authenticity
- Compare the certificate’s public key fingerprint with the attestation’s TLS key fingerprint
- Confirm they match, ensuring the certificate belongs to the attested enclave
- Display the enclave measurements for audit purposes
Proxy
Usetinfoil proxy to start a local HTTP orchestrator that verifies connections and forwards them to the specified enclave:
Docker
A docker image is available atghcr.io/tinfoilsh/tinfoil-cli.

