Team AI
Team AI: the server provides the LLM, with no key of your own. Here is how to use it and how to run it.
Team AI: the server LLM#
On this server: the LLM is not configured (no ANTHROPIC_API_KEY); projects cannot enable it. LLM features (--summary, tkt suggest refs, tkt suggest value, tkt plan from-docs) use a local command by default (claude -p or AITODO_LLM_CMD). A project can use this server instead: it holds the Anthropic key, and the commands pick it on their own when the project enabled it and your token has the llm grant.
- Then never ask the user for an AI key or a
claudelogin. - Prefer
--llm-provider serverwhenAITODO_LLM_CMDis set (it beats the project default) or no localclaudeis logged in. - A server failure never fails the command: stderr shows
ERR_LLM_PROVIDERwith the server's slug, the command falls back, exit 0.ERR_LLM_QUOTA: report it, do not retry before the reset;ERR_RATE_LIMITED: the project runs too many calls, wait and retry once;ERR_PAYLOAD_TOO_LARGE: narrow the input;ERR_LLM_UPSTREAM: retry later once;ERR_LLM_NOT_CONFIGURED: for the operator;ERR_AUTH_FORBIDDEN: nollmgrant or it is off: for the admin.
Details7 items
Overview: https://tkt.ideathon.me/en#csapat-ai. The prompt (ticket and doc text) goes from your machine via the server to Anthropic; the server never stores or logs it (SDK logs below WARNING are muted) and records per call project, token name, time, model and token counts. The project spends its plan's credits, which the server's operator grants (AI plans and prices).
- Check it:
tkt login(as 'ci-bot' (write, llm));GET /v1/projects/{p}:llmEnabled;/whoami:llm; admins:tkt project llm usage --by-token.tkt ticket get <ID> --summary --json:summarySource: llm|cache|fallback, plussetupHinton fallback. - On a server-hosted store (
store: server) the command runs on the server and uses only the project's server LLM, with no switch: the server gives the run a temporary grant that acts as your token on the LLM calls only and is deleted when the run ends. YourAITODO_LLM_CMDdoes not apply; the client drops--llm,--llm-cmd,--llm-provider(… is ignored on a server-hosted store),--no-llmgoes. With the project's LLM off (tkt project llm enable) or nollmon your token (tkt token update <name> --llm) the command runs without it, exit 0, and the notice names the reason. - Provider order (flags > env, explicit > project default):
--no-llm;--llm-cmd;--llm-provider server|local|off;--llm(local);AITODO_LLM_CMD;AITODO_LLM_PROVIDER=server|local|off;llmProviderin the user, then the store config; the project's server LLM (skipped if unreachable); else none, with a notice. Without pin or token--llm-provider serverexits 2, namingtkt project register/tkt login. - Fallbacks: e.g.
[ERR_LLM_QUOTA] Today's AI budget is used up (plan 'team'); it resets at 00:00 UTC.; brief view instead of the summary, suggestions without LLM. Prompts are never split. A 403 is the admin's:tkt token update <name> --llm/tkt project llm enable. - The answer cache:
--summaryandsuggest refs|valueanswers are kept per project, keyed by the hash of the model's input (provider, model, prompt version, prompt, schema): an unchanged ticket (blockers, waiters, warnings) costs the team one call. A hit costs no credits (cacheHits). Stored: hash, answer, model, time, token counts; never the prompt. Entries: 30 days, at most 5000 per project (oldest dropped), deleted with it.--refreshasks again (for a poor answer). A local command caches in.aitodo/cache/llm/(gitignored);AITODO_LLM_CACHE=0uses neither. - Protocol:
llm:completewithcacheable: true(for--summary): lookup, then store; reply{answer, cache: hit|miss|off, generatedAt}. Batches:POST /v1/projects/{p}/llm/cache:lookup{keys}gives{cache: on|off, entries: {key: {answer, generatedAt}}}, thencacheItems: [{key, slot}]for misses, stored per key with its token share.
Running Team AI#
Team AI is off by default: an admin enables it per project and grants llm per token (admin does not imply it: tkt token update ci --llm). What it may spend is the project's plan, granted by the operator (AI plans and prices); with your own or a local LLM tkt sets no limit. Model: claude-opus-5-5; timeout 300 s per Anthropic call, the CLI waits up to 600 s; one request is at most 2 MB.
$ tkt project llm enableDetails6 items
Admin token (no options in a store: server folder):
tkt project llm enable/tkt project llm disable: the project's one server-AI switch, for the LLM and the embedding together; with neither set up on the server, 503ERR_LLM_NOT_CONFIGURED.tkt project llm cache on|off: on by default, off also deletes it.tkt project llm usage --by-token --json: the plan, the share of the monthly and the daily budget used and the resets, the calls today and this month (UTC); never tokens. The admin's own caps (tkt project llm limit) are not available yet:ERR_FEATURE_POSTPONED(501). When the plan grants no server AI,enablesays so.- The daily cap resets at 00:00 UTC, the monthly on day 1. At or over it:
ERR_LLM_QUOTA(429); the call that crosses it completes and counts. Each call reserves its worst case (the prompt and the longest answer) before it starts and settles to its real cost: calls running at once start only up to the remaining budget, the rest getERR_LLM_QUOTA. Per project at most 4 calls run at once and 60 start a minute (AITODO_SERVER_LLM_MAX_INFLIGHT,AITODO_SERVER_LLM_RATE_LIMIT), else 429ERR_RATE_LIMITED. A short outage of the provider (HTTP 429, 500, 502, 503, 504, 529, no connection) is retried up to 2 times, each wait longer, or after itsretry-afterwhen that fits; no retry starts after 290 s, so the request ends inside the CLI's wait. A timeout or a refused request is not retried. The request holds one reservation and one rate-limit slot; only the answered attempt costs. When every attempt fails,ERR_LLM_UPSTREAMnames the count and says the failure is transient. A larger request:ERR_PAYLOAD_TOO_LARGE(413). - Operator:
ANTHROPIC_API_KEYas a secret (without it nothing enables; it never reaches a record, reply, log or page);AITODO_SERVER_LLM_MODEL(defaultclaude-opus-5-5);AITODO_SERVER_LLM_MAX_BYTES(default 2 MB);AITODO_SERVER_LLM_CACHE_TTL(e.g.30d,12h),AITODO_SERVER_LLM_CACHE_MAX,AITODO_SERVER_LLM_MAX_INFLIGHTandAITODO_SERVER_LLM_RATE_LIMIT; invalid values stop the server at startup. Needs theaitodo[server]extra (elseERR_LLM_NOT_CONFIGURED) and a proxy read timeout ≥ 600 s. On a server-hosted store a run's LLM calls go to the server's own port on127.0.0.1(listen there too), bounded byAITODO_CLI_TIMEOUT(default 30 s). - REST:
PATCH /v1/projects/{p}{llmEnabled?, llmCache?};llm:complete{prompt, schema, cacheable?, cacheSlot?, promptVersion?, refresh?, cacheItems?}(read +llm);…/llm/usage?byToken=true(admin);…/llm/status(read):budget.
Commands on this page#
tkt project llm enableMake the server the project's default LLM→
tkt project llm disableSwitch the project's server LLM off; the CLI falls back to a local provider or none→
tkt project llm cacheSwitch the server's cache of the project's LLM answers (on by default)→
tkt project llm usageThe project's AI budget as a share used (its plan's credits, never tokens), the calls made today and this month (UTC), and the answer cache's hits→