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

  1. Check hardware: 16GB+ RAM recommended, a discrete GPU helps.
  2. Install a runtime such as Ollama or LM Studio.
  3. Pull a model of a suitable size (e.g. a quantized 7B/8B).
  4. Start the local server; it listens on a localhost port by default.
  5. 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.