aitododocs Coming soonAutonomous delivery

Team AI

Markdown

Team AI: the server provides the LLM, with no key of your own. Here is how to use it and how to run it.

Guideabout 8 min4 commands
On this page

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 claude login.
  • Prefer --llm-provider server when AITODO_LLM_CMD is set (it beats the project default) or no local claude is logged in.
  • A server failure never fails the command: stderr shows ERR_LLM_PROVIDER with 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: no llm grant 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, plus setupHint on 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. Your AITODO_LLM_CMD does not apply; the client drops --llm, --llm-cmd, --llm-provider (… is ignored on a server-hosted store), --no-llm goes. With the project's LLM off (tkt project llm enable) or no llm on 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; llmProvider in 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 server exits 2, naming tkt 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: --summary and suggest refs|value answers 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. --refresh asks again (for a poor answer). A local command caches in .aitodo/cache/llm/ (gitignored); AITODO_LLM_CACHE=0 uses neither.
  • Protocol: llm:complete with cacheable: 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}}}, then cacheItems: [{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.

Terminal
$ tkt project llm enable
Details6 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, 503 ERR_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, enable says 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 get ERR_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 429 ERR_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 its retry-after when 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_UPSTREAM names the count and says the failure is transient. A larger request: ERR_PAYLOAD_TOO_LARGE (413).
  • Operator: ANTHROPIC_API_KEY as a secret (without it nothing enables; it never reaches a record, reply, log or page); AITODO_SERVER_LLM_MODEL (default claude-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_INFLIGHT and AITODO_SERVER_LLM_RATE_LIMIT; invalid values stop the server at startup. Needs the aitodo[server] extra (else ERR_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 on 127.0.0.1 (listen there too), bounded by AITODO_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#

Generated from the registry: src/aitodo/api/selfdoc_entries/team.py · team.llm, team.llm-adminv0.1.298