Welcome to the Inference.net API examples repository! This collection provides code samples and guides for common tasks using the Inference.net API.
To run these examples, you'll need:
- An Inference.net account - Create a free account here
- An API key from your account dashboard
You can set up your API key in one of two ways:
-
Environment Variable:
export INFERENCE_API_KEY=your_api_key_here
-
.env File (recommended for development): Create a
.env
file in your project root:INFERENCE_API_KEY=your_api_key_here
Most IDEs (like VS Code) will automatically load this file.
Most examples are written in Python, but the concepts can be applied to any language.
- Webhook Example - A minimalistic API that uses Inference.net to detect Magnus Carlsen in images using webhooks
- RAG with ChromaDB, Chonkie, and Paul Graham's Essays - End-to-end Retrieval-Augmented Generation pipeline using Inference.net, ChromaDB, and Chonkie
- ClipTagger-12B Semantic Video Search With Chroma - Semantic search and filtering over video frames using ClipTagger-12B and ChromaDB
- Video Captioning with VLMs: Generic Model Example
- Sentiment Analysis with Structured Outputs
- Batch Processing - Process multiple asynchronous requests in a single API call
- Function Calling - Give your models tools
- Structured Outputs - Have your models output structured outputs
- Vision - Process images with AI models
- Background Inference - Use the asynchronous API for cost-effective processing
MIT License