Overview
Instead of claiming third-party credits, run open-weight models locally. Ollama, LM Studio and llama.cpp can load models on a personal computer and expose an OpenAI-compatible local endpoint.
Steps
- Check hardware: 16GB+ RAM recommended, a discrete GPU helps.
- Install a runtime such as Ollama or LM Studio.
- Pull a model of a suitable size (e.g. a quantized 7B/8B).
- Start the local server; it listens on a localhost port by default.
- Point your code's base_url at the local address.
Caveats
- Local inference is free of API fees but uses power and hardware; speed depends on your machine.
- Small models are limited; complex tasks may still need a cloud model.
- Check the model license before commercial use.
Use cases
Privacy-sensitive data, offline environments, high-frequency simple calls.