Skip to content

Tileward

Run large models on hardware you own, governed.

One package, two faces. import tileward is a typed Python client; twcli is the command line over the same client. Everything one can do, the other can do.

pip install tileward

Python 3.9 or newer. Three dependencies: httpx, click, rich.

What it covers

Library Command
Tileward Models — an OpenAI-compatible chat surface tw.chat, tw.models twcli chat, twcli models
Tileward Governance — allow / deny before the model writes a token tw.guard twcli guard
Tileward Context — recall the slice of history a question needs tw.context twcli context
Tileward Documents — answers from your own files tw.documents twcli docs
Account and keys tw.keys, tw.account twcli keys, twcli account

Two lines to a first call

from tileward import Tileward

tw = Tileward()                                   # reads TILEWARD_API_KEY
print(tw.chat.say("Say hello in one sentence."))
twcli chat "Say hello in one sentence."

Three things to know before you start

An API key and a console session are different credentials. The key (tw_live_…) calls the model, the guard, Context and Documents. Minting keys, reading billing and binding policies need a console session from twcli auth login. A key that could mint keys would survive its own revocation, so it cannot. See Keys and sessions.

There are three hosts and they do not overlap. api.tileward.com serves /v1 only, app.tileward.com serves the account surface, and Context lives on context.tileward.com. The client routes by which credential a call needs, so you never set this by hand — but a config that points everything at one host will not work. See Hosts.

A governed refusal is not an HTTP error. It arrives as an ordinary completion with finish_reason: "content_filter" and zero tokens billed. create() passes it through; only say() raises GuardRefusal. See Errors.

Where to go next

Elsewhere