https://github.com/context-labs/inference-samples
Cookbooks, examples, and guides for using the Inference API.
https://github.com/context-labs/inference-samples
Last synced: 9 months ago
JSON representation
Cookbooks, examples, and guides for using the Inference API.
- Host: GitHub
- URL: https://github.com/context-labs/inference-samples
- Owner: context-labs
- License: mit
- Created: 2025-06-04T21:26:27.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-20T00:55:22.000Z (12 months ago)
- Last Synced: 2025-06-20T01:34:14.721Z (12 months ago)
- Size: 4.24 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# Inference.net API Examples
Welcome to the Inference.net API examples repository! This collection provides code samples and guides for common tasks using the Inference.net API.
## Getting Started
To run these examples, you'll need:
1. An Inference.net account - [Create a free account here](https://inference.net/signin)
2. An API key from your account dashboard
### Setting Up Your API Key
You can set up your API key in one of two ways:
1. **Environment Variable**:
```bash
export INFERENCE_API_KEY=your_api_key_here
```
2. **.env File** (recommended for development):
Create a `.env` file in your project root:
```bash
INFERENCE_API_KEY=your_api_key_here
```
Most IDEs (like VS Code) will automatically load this file.
## Available Resources
Most examples are written in Python, but the concepts can be applied to any language.
### Featured Examples
#### Example Notebooks
- [Webhook Example](examples/webhook-classification/README.md) - A minimalistic API that uses Inference.net to detect Magnus Carlsen in images using webhooks
- [RAG with ChromaDB, Chonkie, and Paul Graham's Essays](examples/RAG-chroma/RAG-chroma.ipynb) - End-to-end Retrieval-Augmented Generation pipeline using Inference.net, ChromaDB, and Chonkie
- [ClipTagger-12B Semantic Video Search With Chroma](examples/cliptagger-video-search/cliptagger-video-search.ipynb) - Semantic search and filtering over video frames using ClipTagger-12B and ChromaDB
- [Video Captioning with VLMs: Generic Model Example](examples/video-captioning/video-captioning.ipynb)
- [Sentiment Analysis with Structured Outputs](examples/sentiment-analysis/sentiment-analysis.ipynb)
#### API Features & Resources
- [Batch Processing](https://docs.inference.net/features/batch-api) - Process multiple asynchronous requests in a single API call
- [Function Calling](https://docs.inference.net/features/function-calling) - Give your models tools
- [Structured Outputs](https://docs.inference.net/features/structured-outputs) - Have your models output structured outputs
- [Vision](https://docs.inference.net/features/vision) - Process images with AI models
- [Background Inference](https://docs.inference.net/features/asynchronous-inference/overview) - Use the asynchronous API for cost-effective processing
## License
MIT License