Self-hosted model cost tracking (vLLM, Ollama, TGI)

Put a price on models you run yourself with vLLM, Ollama or TGI, attribute every call, and check the price against your GPU bill.

By Keyveve, Inc. · Updated 2026-10-23

Models on your own GPUs have no price list, so give them one: work out what a million output tokens (or an image, or a second of video) costs you, save it as a custom price, and send the calls under that provider name.

Send calls

import veqen
from openai import OpenAI

veqen.init()  # reads VEQEN_API_KEY, an ingest key
local = veqen.wrap(OpenAI(base_url="http://vllm.internal:8000/v1", api_key="unused"), provider="self-hosted",
                   feature="classify")

with veqen.tags(customer=org.id):
    local.chat.completions.create(model="Qwen/Qwen3-32B", messages=messages)
import OpenAI from "openai";
import { wrap } from "@veqen/sdk";

const local = wrap(new OpenAI({ baseURL: "http://localhost:11434/v1", apiKey: "ollama" }), { provider: "self-hosted", feature: "classify" });

vLLM, Ollama, TGI, SGLang and llama.cpp's server all speak the OpenAI API, so the same code works with each. Image, video and other models: call record() with the units each job produced.

Price it

Add a model price under Settings › Your prices for the self-hosted provider. The worked examples in Custom prices turn a GPU's hourly rate, utilization and throughput into a per-token or per-unit price. Calls received after you save the price use it.

Check it against the GPU bill

Enter the month's GPU or cloud bill on the Bill check page under the same provider name, or import the provider's billing export there. The capture rate shows how close your price is. Use as price spreads the bill over the tokens you served and saves that as the price, so later calls cost what the hardware actually did.

Next

Veqen records what every AI request cost and who it was for, checks it against your provider bills and prepares the entries for your accounting system. Start free or read the quickstart.