Skip to main content
When you run AI models locally — on Ollama, llama.cpp, vLLM, LM Studio, or any other self-hosted inference server — there is no per-token API bill. Your real cost is electricity and GPU time. CostHQ lets you register local models with a cost-per-hour rate so you can track compute costs alongside your cloud API spend in the same dashboard.

Quick start

Cost formula

For example, 2 minutes 30 seconds on a model registered at $0.50/hr:

Managing local models

Register a model

List registered models

Remove a model

Auto-detect Ollama models

If you have Ollama running locally, CostHQ can scan localhost:11434 and register all available models in one command:
This hits Ollama’s GET /api/tags endpoint, pulls every loaded model name, and registers them all with the rate you specify.

Logging local model usage

Use the standard cs log-ai command with the new --duration flag:

The --local flag

CostHQ auto-recognizes these providers as local: ollama, llamacpp, llama.cpp, vllm, lmstudio, localai, jan, koboldcpp. If your provider isn’t in that list, use the --local flag to explicitly tell CostHQ to use compute-time costing:

JSON output

When you log a local model call with --json, the pricing object shows source: "local":

Estimating your GPU cost per hour

If you’re not sure what --cost-per-hour rate to use, here are some reference points:
Pick a rate that makes sense for your setup. You can always update it later with cs local-models add — it upserts, so re-registering the same model replaces the old rate.
Local model configurations are stored in ~/.costhq/local-models.json. This file is independent from the session database and can be version-controlled or shared across machines.