Image Analysis with Tinfoil
Learn how to analyze images privately using Mistral’s vision capabilities through the Tinfoil Private Inference API.
Introduction
The Tinfoil Private Inference API enables you to perform image analysis using Mistral’s vision capabilities while ensuring complete privacy. Unlike traditional cloud AI services, your images never leave the secure enclave environment, protecting sensitive visual data from exposure.
Prerequisites
For this tutorial, you’ll need:
- A Tinfoil API key (get one at tinfoil.sh)
- Python 3.7 or higher
- An image file to analyze (e.g.,
apple.png
)
You’re billed for all usage of the Tinfoil Inference API. See the Tinfoil Pricing for current pricing information.
Security Warning Never share your API key, be careful to not include it in version control systems, and never bundle it in with front-end client code.
Install the Tinfoil SDK
First, install the Tinfoil Python SDK:
Image Analysis Example
Here’s a complete example that demonstrates how to analyze an image using Mistral’s vision capabilities through Tinfoil:
Supported Image Formats
Mistral’s vision model supports common image formats including:
- JPEG (.jpg, .jpeg)
- PNG (.png)
- GIF (.gif)
- WebP (.webp)
Best Practices For optimal results, use high-quality images with clear subjects. The model performs better on images with good contrast and resolution.
Next Steps
- Explore other available models on Tinfoil
- Learn about enclave verification for additional security