<?xml version="1.0" encoding="UTF-8"?><database name="clinerhythm" schema="public" type="PostgreSQL - 18.4 (Ubuntu 18.4-1.pgdg24.04+1)">
   <sequences>
      <sequence increment="1" name="quota_id_seq" startValue="1"/>
      <sequence increment="1" name="usage_id_seq" startValue="1"/>
   </sequences>
   <tables>
      <table name="quota" remarks="{&quot;what&quot;:&quot;Snapshot of service quota state at a given timestamp.&quot;,&quot;why&quot;:&quot;Without it, historical quota usage and limits are unknown, preventing trend analysis and limit forecasting.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:22:49.119131664+00:00&quot;}" schema="public" type="TABLE">
         <column autoUpdated="true" defaultValue="nextval('quota_id_seq'::regclass)" digits="0" id="0" name="id" nullable="false" remarks="{&quot;what&quot;:&quot;Unique numeric identifier for each quota snapshot row.&quot;,&quot;why&quot;:&quot;Without it, rows cannot be uniquely referenced for updates or joins.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:22:49.225711736+00:00&quot;}" size="19" type="bigserial" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="1" name="ts" nullable="false" remarks="{&quot;what&quot;:&quot;UTC timestamp when this quota snapshot was recorded.&quot;,&quot;why&quot;:&quot;Without it, the order and timing of quota changes is unknown, breaking time-series analysis.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:22:49.247611431+00:00&quot;}" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="'unknown'::text" digits="0" id="2" name="from_service" nullable="false" remarks="{&quot;what&quot;:&quot;Name of the service the quota applies to, e.g. 'openai'.&quot;,&quot;why&quot;:&quot;Without it, quota data from different services cannot be distinguished, mixing limits and usage.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:22:49.328660404+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="rolling_5h_remaining" nullable="true" remarks="{&quot;what&quot;:&quot;Remaining quota units in the rolling 5-hour window.&quot;,&quot;why&quot;:&quot;Without it, current headroom for the 5-hour window is unknown, so requests may be rejected unexpectedly.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:22:49.387671865+00:00&quot;}" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="rolling_5h_max" nullable="true" remarks="{&quot;what&quot;:&quot;Maximum quota units allowed in the rolling 5-hour window.&quot;,&quot;why&quot;:&quot;Without it, the limit for the 5-hour window is unknown, so remaining percentage cannot be computed.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:22:49.426606030+00:00&quot;}" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="rolling_5h_limited" nullable="true" remarks="{&quot;what&quot;:&quot;Whether the 5-hour window is currently rate-limited.&quot;,&quot;why&quot;:&quot;Without it, it's unknown if requests are being throttled, causing confusion about failures.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:22:49.507814356+00:00&quot;}" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="subscription_limit" nullable="true" remarks="{&quot;what&quot;:&quot;Total quota units allowed per subscription period.&quot;,&quot;why&quot;:&quot;Without it, the overall cap for the subscription is unknown, so usage cannot be compared to the plan.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:22:49.614118480+00:00&quot;}" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="subscription_requests" nullable="true" remarks="{&quot;what&quot;:&quot;Number of requests counted against the subscription limit.&quot;,&quot;why&quot;:&quot;Without it, subscription usage is unknown, so remaining quota cannot be determined.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:22:49.640492630+00:00&quot;}" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="17" id="8" name="weekly_percent_remaining" nullable="true" remarks="{&quot;what&quot;:&quot;Percentage of weekly quota remaining, from 0 to 100.&quot;,&quot;why&quot;:&quot;Without it, the weekly usage ratio is unknown, making it hard to plan spending.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:22:49.663769707+00:00&quot;}" size="17" type="float8" typeCode="8"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="weekly_remaining_credits" nullable="true" remarks="{&quot;what&quot;:&quot;Remaining weekly credits as a string, possibly with unit suffix.&quot;,&quot;why&quot;:&quot;Without it, the exact remaining credit amount is unknown, and the string format may include units.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:22:49.690786183+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="weekly_max_credits" nullable="true" remarks="{&quot;what&quot;:&quot;Maximum weekly credits as a string, possibly with unit suffix.&quot;,&quot;why&quot;:&quot;Without it, the weekly cap is unknown, so remaining percentage cannot be computed.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:22:49.709133585+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="raw" nullable="true" remarks="{&quot;what&quot;:&quot;Raw JSON payload from the quota API for this snapshot.&quot;,&quot;why&quot;:&quot;Without it, fields not captured in columns are lost, preventing future extraction of new metrics.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:22:49.737527174+00:00&quot;}" size="2147483647" type="jsonb" typeCode="1111"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="12" name="next_tick_at" nullable="true" remarks="{&quot;what&quot;:&quot;Timestamp when the next quota reset or tick is scheduled.&quot;,&quot;why&quot;:&quot;Without it, the time until quota refresh is unknown, so scheduling of requests cannot be optimized.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:22:49.753867335+00:00&quot;}" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="17" id="13" name="tick_percent" nullable="true" remarks="{&quot;what&quot;:&quot;Percentage of quota used at the next tick, likely 0-100.&quot;,&quot;why&quot;:&quot;Without it, the expected usage at reset is unknown, so proactive adjustments are impossible.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:22:49.802510614+00:00&quot;}" size="17" type="float8" typeCode="8"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="quota_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="quota_remaining_ts_idx" unique="false">
            <column ascending="true" name="ts"/>
         </index>
         <index name="quota_ts_idx" unique="false">
            <column ascending="false" name="ts"/>
         </index>
      </table>
      <table name="usage" remarks="{&quot;what&quot;:&quot;Per-request LLM usage metrics: tokens, latency, cost, and outcome.&quot;,&quot;why&quot;:&quot;Without it, token consumption and cost attribution across services are unknown.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:22:07.887782405+00:00&quot;}" schema="public" type="TABLE">
         <column autoUpdated="true" defaultValue="nextval('usage_id_seq'::regclass)" digits="0" id="0" name="id" nullable="false" remarks="{&quot;what&quot;:&quot;Surrogate primary key, auto-incrementing sequence value.&quot;,&quot;why&quot;:&quot;Provides a unique row identifier for joins and stable ordering.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:22:07.935123076+00:00&quot;}" size="19" type="bigserial" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="request_id" nullable="false" remarks="{&quot;what&quot;:&quot;UUID identifying the originating API request.&quot;,&quot;why&quot;:&quot;Links usage rows to request logs; without it, multiple calls per request are indistinguishable.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:22:07.960345453+00:00&quot;}" size="2147483647" type="uuid" typeCode="1111"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="2" name="ts" nullable="false" remarks="{&quot;what&quot;:&quot;UTC timestamp when the usage record was created.&quot;,&quot;why&quot;:&quot;Enables time-based aggregation and billing periods; missing it loses temporal context.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:22:07.987548312+00:00&quot;}" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="model" nullable="false" remarks="{&quot;what&quot;:&quot;Model identifier string, e.g. 'gpt-4o'.&quot;,&quot;why&quot;:&quot;Needed to apply per-model pricing and capacity planning.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:22:08.031683276+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="'unknown'::text" digits="0" id="4" name="from_service" nullable="false" remarks="{&quot;what&quot;:&quot;Name of the calling service or component.&quot;,&quot;why&quot;:&quot;Attributes usage to the originating service for cost allocation and anomaly detection.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:22:08.073408415+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="false" digits="0" id="5" name="stream" nullable="false" remarks="{&quot;what&quot;:&quot;True if the response was streamed, false if buffered.&quot;,&quot;why&quot;:&quot;Streaming affects token timing and cost; without it, latency metrics are misinterpreted.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:22:08.141239671+00:00&quot;}" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="6" name="prompt_tokens" nullable="false" remarks="{&quot;what&quot;:&quot;Number of tokens in the input prompt.&quot;,&quot;why&quot;:&quot;Basis for input cost calculation and usage quotas.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:22:08.176462815+00:00&quot;}" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="7" name="completion_tokens" nullable="false" remarks="{&quot;what&quot;:&quot;Number of tokens generated in the response.&quot;,&quot;why&quot;:&quot;Basis for output cost and throughput analysis.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:22:08.201794803+00:00&quot;}" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="8" name="reasoning_tokens" nullable="false" remarks="{&quot;what&quot;:&quot;Tokens used for model reasoning (e.g., chain-of-thought).&quot;,&quot;why&quot;:&quot;Separates reasoning cost from completion; without it, cost attribution is incomplete.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:22:08.227593285+00:00&quot;}" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="9" name="cached_tokens" nullable="false" remarks="{&quot;what&quot;:&quot;Tokens served from cache, not newly processed.&quot;,&quot;why&quot;:&quot;Affects pricing and latency; missing it overstates compute cost.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:22:08.251209567+00:00&quot;}" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="ttft_ms" nullable="true" remarks="{&quot;what&quot;:&quot;Time to first token in milliseconds.&quot;,&quot;why&quot;:&quot;Measures perceived latency; without it, streaming responsiveness is unknown.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:22:08.261682259+00:00&quot;}" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="total_ms" nullable="true" remarks="{&quot;what&quot;:&quot;Total request duration in milliseconds.&quot;,&quot;why&quot;:&quot;Provides end-to-end latency for performance monitoring.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:22:08.278356702+00:00&quot;}" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="17" id="12" name="decode_tok_s" nullable="true" remarks="{&quot;what&quot;:&quot;Decode speed in tokens per second.&quot;,&quot;why&quot;:&quot;Indicates generation throughput; without it, efficiency comparisons are impossible.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:22:08.299202381+00:00&quot;}" size="17" type="float8" typeCode="8"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="status" nullable="true" remarks="{&quot;what&quot;:&quot;HTTP status code or internal error code.&quot;,&quot;why&quot;:&quot;Distinguishes successful calls from failures; without it, error rate is unknown.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:22:08.338212536+00:00&quot;}" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="17" id="14" name="cost_usd" nullable="true" remarks="{&quot;what&quot;:&quot;Monetary cost of the request in US dollars.&quot;,&quot;why&quot;:&quot;Directly feeds billing and budget tracking; missing it hides spend.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:22:08.348717157+00:00&quot;}" size="17" type="float8" typeCode="8"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="15" name="backend" nullable="true" remarks="{&quot;what&quot;:&quot;Backend provider or endpoint used for the call.&quot;,&quot;why&quot;:&quot;Identifies which infrastructure served the request for reliability and cost analysis.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:22:08.397640701+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="usage_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="usage_model_idx" unique="false">
            <column ascending="true" name="model"/>
            <column ascending="false" name="ts"/>
         </index>
         <index name="usage_ts_idx" unique="false">
            <column ascending="false" name="ts"/>
         </index>
      </table>
   </tables>
</database>
