Hosted inference APIs
Cloud captioning with no local GPU: OpenAI, Hugging Face Inference Providers, Replicate and NVIDIA NIM. Each needs an API key, and each request sends the image to that provider.
Used by
Official guides
- OpenAI API quickstart (opens in new tab)
- Hugging Face Inference Providers (opens in new tab)
- Replicate docs (opens in new tab)
- NVIDIA NIM APIs (opens in new tab)
Minimal setup
-
Create an API key with the provider.
-
Install the extra the backend needs:
pip install 'argus-lens[openai]'or'argus-lens[replicate]'. The Hugging Face and NIM backends need no extra. -
Export the key and pick the backend:
export OPENAI_API_KEY=… argus-lens caption ./images/ --backend openai
Every image you caption this way is uploaded to that provider. Read their data-retention terms before captioning anything private.
In Studio's compose, set the key in the repo-root .env, and compose passes it to
lens. The published lens image includes the Hugging Face and NIM backends.
openai and replicate also need their extras, so build lens from source with
LENS_EXTRAS=server,local,openai,replicate and -f compose.build.yaml.