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 R1 - deepseek-r1-0528
DeepSeek R1 - deepseek-r1-0528
Alias:
deepseek
Mistral Small 3.1 24B - mistral-small-3-1-24b
Mistral Small 3.1 24B - mistral-small-3-1-24b
Alias:
mistral
Llama 3.3 70B - llama3-3-70b
Llama 3.3 70B - llama3-3-70b
Alias:
llama
Qwen 2.5 72B - qwen2-5-72b
Qwen 2.5 72B - qwen2-5-72b
Alias:
qwen
Audio Models
Whisper Large V3 Turbo - whisper-large-v3-turbo
Whisper Large V3 Turbo - whisper-large-v3-turbo
Alias:
whisper
Kokoro - kokoro
Kokoro - kokoro
Alias:
tts
Embedding Models
Nomic Embed Text - nomic-embed-text
Nomic Embed Text - nomic-embed-text
Alias:
embed
Chat
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 (
-s
flag): 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:Audit Attestation
You can also verify attestations at random and record a machine-readable audit log. Use theattestation audit
command for this purpose.
By default the audit record is printed to stdout as JSON. To write it to a file, use the -l/--log-file
flag:
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
.
Troubleshooting
Common error resolutions:PCR register mismatch
: Running enclave code differs from source repo