Skip to content

Add Liquid AI backend with per-model prices; release 0.9.0 - #24

Merged
DevMortimer merged 2 commits into
mainfrom
liquid-backend
Oct 3, 2026
Merged

DevMortimer merged 2 commits into
mainfrom
liquid-backend

Conversation

@DevMortimer

Copy link
Copy Markdown
Owner

Adds liquid, a registry backend for Liquid AI's decision models, which serve the same decisions protocol.

  • createTypeSafe({ backend: "liquid" }) sends judgments to api.liquid.ai under /decisions/v1/systemone with the key from LIQUID_API_KEY. The model list is read from /decisions/v1/models and checks the key, so listModels() verifies it.
  • The default model is d1:free, which is free. model: "d1" selects the paid model.
  • A registry backend can now name a price per model (prices): d1 at $0.040 and d1:free at $0 per million input tokens. A client without a caller usdPerMTok prices each request at its backend's price for the model it sends, and usdPerMTok: 0 is accepted.
  • The usage ledger records each request's cost at its own price, so the daily spend and the usdPerDay cap stay right when one ledger holds requests to models with different prices. Free requests add nothing. Ledger files written before this change are read and estimated as before.
  • The README, API docs, and changelog cover the backend, its prices, and two measured differences from TypeSafe: Liquid counts the state once per question, and d1:free took a median of about 14 seconds per request when requests were sent one at a time, so callers raise timeoutMs or use d1.

The last commit bumps the version to 0.9.0 and moves the changelog notes under ## 0.9.0.

Verification:

  • npm run check: 147 tests, all pass.
  • Against Liquid's API with the built package: the model list returned d1 and d1:free, and one evaluate on d1:free with a noul, a choice, and a score question returned all three answers.

Add a liquid backend for Liquid AI's decision models (default model d1:free), let a registry backend name a price per model, accept usdPerMTok 0, and record each request's cost at its own price so the daily spend and the usdPerDay cap stay right across models and backends.
@DevMortimer
DevMortimer merged commit bca8f72 into main Oct 3, 2026
8 checks passed
@DevMortimer
DevMortimer deleted the liquid-backend branch October 3, 2026 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant