# Serverless AI Architecture

CURRENT_STATUS: UNKNOWN
OBSERVATION: SPEC_ONLY
FRESHNESS: UNKNOWN
PAGE_TYPE: reference
CANONICAL_URL: /tools/ea-086-serverless-ai-architecture
CLAIM_IDS: none
EVIDENCE_IDS: EVD-EA-086-URL-44B5D8B4F201, EVD-EA-086-URL-C784C5865F16, EVD-EA-086-URL-8CCB457B5EA0, EVD-EA-086-URL-16F9BE23F7EC, EVD-EA-086-URL-728ABC12B871, EA-086-R11-RESEARCH, EA-086-R11-WEB-READBACK
UNKNOWN_IDS: EA-086-UNKNOWN-01, EA-086-UNKNOWN-CURRENTNESS
OPS_IDS: none

## Summary
「Serverless AIは、小規模・断続的・event-drivenなAI処理で常時稼働基盤を減らせる有力な実装形である。ただし実行時間、再試行、重複配送、quota、GPU/region、cold pathはproviderごとに異なる。外部side effectを伴う処理ではdurable stateとidempotencyを設計契約に含める。」

## Current judgment
1. Serverless AIの適切なCoreは「LLMをfunction内へ必ず載せる」ではない。小さなorchestrator/functionがeventを受け、durable queue/stateへ記録し、managed model APIまたは別inference serviceを呼び、結果をdurable storeへcommitする形が最もportableである。
2. execution timeoutはprovider/plan/runtimeで異なる。AWS Lambda標準functionは最大15分、Azure Functionsはhosting planで大きく異なりHTTP応答には別の230秒境界、Cloud Run Jobsは通常task最大7日だがGPU taskは1時間である。よって「serverlessだから短時間」も「container serverlessなら無制限」も一般化不可。
3. queue/event integrationはduplicateを前提にする。AWS Lambda+SQSはat-least-onceでduplicate processingを明記しているため、AI call・billing・email送信・DB mutation等のside effectはidempotency key、deduplication record、outbox/transaction boundaryが必要。
4. GPU serverlessは実在するがavailability gateが強い。Cloud Run GPUはscale-to-zero可能で、L4/RTX PRO 6000 Blackwellをmanagedで提供する一方、GPU type、region、CPU/RAM minimum、one-GPU-per-instance等の制約がある。GPU availabilityをCPU serverlessと同等に扱わない。
5. cold startだけでなくmodel initialization、weight download、tokenizer/runtime initialization、network path、upstream model rate limitを別々に測る必要がある。platform instance startup値をend-to-end TTFT保証へ外挿しない。

## Scope
Enterprise AI Core / infrastructure / implementation / interoperability / governance / cost / operability / provider mapping

## Confirmed
- Serverless AIの適切なCoreは「LLMをfunction内へ必ず載せる」ではない。小さなorchestrator/functionがeventを受け、durable queue/stateへ記録し、managed model APIまたは別inference serviceを呼び、結果をdurable storeへcommitする形が最もportableである。
- execution timeoutはprovider/plan/runtimeで異なる。AWS Lambda標準functionは最大15分、Azure Functionsはhosting planで大きく異なりHTTP応答には別の230秒境界、Cloud Run Jobsは通常task最大7日だがGPU taskは1時間である。よって「serverlessだから短時間」も「container serverlessなら無制限」も一般化不可。
- queue/event integrationはduplicateを前提にする。AWS Lambda+SQSはat-least-onceでduplicate processingを明記しているため、AI call・billing・email送信・DB mutation等のside effectはidempotency key、deduplication record、outbox/transaction boundaryが必要。
- GPU serverlessは実在するがavailability gateが強い。Cloud Run GPUはscale-to-zero可能で、L4/RTX PRO 6000 Blackwellをmanagedで提供する一方、GPU type、region、CPU/RAM minimum、one-GPU-per-instance等の制約がある。GPU availabilityをCPU serverlessと同等に扱わない。
- cold startだけでなくmodel initialization、weight download、tokenizer/runtime initialization、network path、upstream model rate limitを別々に測る必要がある。platform instance startup値をend-to-end TTFT保証へ外挿しない。

## UNKNOWN
- EA-086-UNKNOWN-01: 2026-09-16時点の各provider exact price/concurrency quota、Cloud Run GPUの全region inventory、Azure Flex Consumptionのtenant別availability、AWS Lambda Managed Instancesの全適用条件。STOP_CONDITION: execution semantics、duplicate/retry boundary、GPU serverless availability gate、safe architecture contractが一次資料で確立したためEA-086の初回bounded packetは完了。価格/region/quotaは公開後Workで再確認する。


---

---
- EA-086-UNKNOWN-CURRENTNESS: 外部根拠の再確認日がcanonical body/control-planeで確定していないため、currentnessはUNKNOWNとして保持する。日付を推測補完しない。

## Evidence
- EVD-EA-086-URL-44B5D8B4F201 (RESEARCH): 1. official spec/docs | AWS Lambda — Configure Lambda function timeout | Amazon Web Services | — https://docs.aws.amazon.com/lambda/latest/dg/configuration-timeout.html
- EVD-EA-086-URL-C784C5865F16 (RESEARCH): 2. official spec/docs | Using Lambda with Amazon SQS | Amazon Web Services | — https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html
- EVD-EA-086-URL-8CCB457B5EA0 (RESEARCH): 3. official spec/docs | Cloud Run GPU support for services | Google Cloud | — https://docs.cloud.google.com/run/docs/configuring/services/gpu
- EVD-EA-086-URL-16F9BE23F7EC (RESEARCH): 4. official spec/docs | Create jobs — Cloud Run | Google Cloud | — https://cloud.google.com/run/docs/create-jobs
- EVD-EA-086-URL-728ABC12B871 (RESEARCH): 5. official spec/docs | Azure Functions Scale and Hosting | Microsoft | — https://learn.microsoft.com/azure/azure-functions/functions-scale
- EA-086-R11-RESEARCH (RESEARCH): EA-086 監査済みresearch / canonical revision binding
- EA-086-R11-WEB-READBACK (IMPL): EA-086 Web body identity / canonical readback

## Failure / limits
function timeout前にupstream model callが長引けばpartial work/duplicate retryが起こり得る。
## Failure / limits
queue redeliveryは障害ではなくdelivery semanticsの一部。handler非idempotentなら二重課金・二重通知・二重mutationになり得る。
## Failure / limits
scale-to-zeroはidle costを下げる一方、cold path latencyを増やし得る。
## Failure / limits
GPU startup約5秒というCloud Run値はcontainer内model readiness/weight load/TTFTを保証しない。
## Failure / limits
serverless providerのquota、concurrency、region、GPU inventory、network egress、secret/IAM設定はtenantごとに異なる。
## Failure / limits
long-running agentを単一request/function invocationへ閉じ込めるとtimeout・retry・checkpoint lossが増える。durable workflow/state machineへ分解すべきケースがある。
## Practice
provider / region / hosting plan / runtime generation / trigger type / timeout / concurrency quota / queue semantics / GPU type and inventory / CPU-memory minimum / VPC-network path / model endpoint region / secret manager and IAM / payload size / retry-DLQ policy / pricing revision。
## Practice
VERIFIED_SPEC: Lambda+SQS、Cloud Run services/jobs/GPU、Azure Functionsで実装可能な構成要素を確認。PROPOSAL: 将来Coreに `SERVERLESS_AI_EXECUTION_CONTRACT` を置く。fields: event_id/idempotency_key, trigger/source, queue/topic, payload hash/schema, function/container image digest, runtime revision, timeout, retry/backoff, DLQ, model endpoint/model ID, request hash, response artifact, durable checkpoint, side-effect commit key, region, concurrency, cold/warm marker, latency breakdown, cost attribution, audit trace。
## Practice
TEST_PROFILE（未実施）: warm/cold、single/burst、duplicate event、upstream 429/5xx、timeout直前response、poison message、partial batch failure、DLQ replay、model endpoint latency spike、GPU scale-from-zeroを固定fixture化。p50/p95/p99 end-to-end latency、cold-start contribution、duplicate side-effect rate、retry amplification、DLQ rate、success after retry、cost/request、idle cost、model-ready time、audit completenessを分離計測する。
## Practice
Security: least-privilege service identity、secret manager、private egress/VPC要否、webhook/event authenticity、payload classificationを別管理。Privacy: queue/log/DLQにpromptやPIIが残る可能性をretention対象化。Audit: event→invocation→model request→side effectをtrace/idempotency keyで結ぶ。Cost: function/container computeだけでなくqueue、egress、model tokens、GPU startup/idle、retry amplificationを含める。Operability: DLQ replay、rollback、quota exhaustion、region failoverをrunbook化。
## Practice
provider mapping時にAWS Lambda/SQS、Google Cloud Run/Tasks/Pub/Sub、Azure Functions/Service Bus等を同一比較軸へmapする。
## Practice
pricing・quota・GPU region/typeは公開後更新時に再pinする。
## Practice
EA-085 Event-driven AIのEVENT_TO_ACTION_CONTRACTと重複統合せず、EA-086はexecution substrate/cost/timeout/cold pathを担当する。
## Practice
long-running agent/workflowはDurable Functions/Step Functions/Workflows等のdurable orchestrationを別subsectionで追加採集する。
## WHY_THIS_MATTERS_TO_UPDATE
小規模AI業務では常時稼働clusterを持たず、event-triggered function、queue、managed container、scale-to-zero inferenceを組み合わせることで運用負荷とidle costを下げられる。一方「serverless」は無制限・状態保持・exactly-once・GPU常時即応を意味しない。AI API latency、cold start、model load、retry、duplicate delivery、execution timeout、GPU region/shape availabilityを設計契約へ明示しないと、安価なPoCから本番へ移る際にfailure envelopeが急拡大する。

## SCOPE_ROUTING
Enterprise AI Core / infrastructure / implementation / interoperability / governance / cost / operability / provider mapping

## CLAIM_OR_RESEARCH_QUESTION
Serverless AIは、AI modelそのものではなく「短命compute + durable queue/state + idempotent handler + external/managed model endpoint」を基本形にするとboundedに成立するか。GPU serverless/container serverlessを含め、どの制約をavailability gateとして分離すべきか。

## EVIDENCE TABLE
1. official spec/docs | AWS Lambda — Configure Lambda function timeout | Amazon Web Services | https://docs.aws.amazon.com/lambda/latest/dg/configuration-timeout.html | accessed 2026-09-16 | current docs | locator: timeout default 3s; standard function max 900s/15min; Managed Instances async/event-source mappingの一部は5400s/90min | VERIFIED_SPEC / PRODUCT_VOLATILE | support + limit
2. official spec/docs | Using Lambda with Amazon SQS | Amazon Web Services | https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html | accessed 2026-09-16 | current docs | locator: event source mapping is at-least-once; duplicate processing can occur; idempotent function recommended | VERIFIED_SPEC | support + counter
3. official spec/docs | Cloud Run GPU support for services | Google Cloud | https://docs.cloud.google.com/run/docs/configuring/services/gpu | accessed 2026-09-16 | current docs | locator: RTX PRO 6000 Blackwell 96GB / L4 24GB; one GPU per instance; scale-to-zero; on-demand; GPU-equipped instance startup approx. 5s; supported regions enumerated | VERIFIED_SPEC / PRODUCT_VOLATILE | support + availability limit
4. official spec/docs | Create jobs — Cloud Run | Google Cloud | https://cloud.google.com/run/docs/create-jobs | accessed 2026-09-16 | current docs | locator: task timeout default 10min, configurable to 168h; GPU task max 1h; retry configurable | VERIFIED_SPEC / PRODUCT_VOLATILE | support + limit
5. official spec/docs | Azure Functions Scale and Hosting | Microsoft | https://learn.microsoft.com/azure/azure-functions/functions-scale | accessed 2026-09-16 | current docs | locator: Flex/Premium/Dedicated/Container Apps timeout differs; Consumption default 5min/max10min; HTTP-triggered response max 230s due load balancer; async pattern recommended for longer work | VERIFIED_SPEC / PRODUCT_VOLATILE | context + limit

## FINDINGS
1. Serverless AIの適切なCoreは「LLMをfunction内へ必ず載せる」ではない。小さなorchestrator/functionがeventを受け、durable queue/stateへ記録し、managed model APIまたは別inference serviceを呼び、結果をdurable storeへcommitする形が最もportableである。
2. execution timeoutはprovider/plan/runtimeで異なる。AWS Lambda標準functionは最大15分、Azure Functionsはhosting planで大きく異なりHTTP応答には別の230秒境界、Cloud Run Jobsは通常task最大7日だがGPU taskは1時間である。よって「serverlessだから短時間」も「container serverlessなら無制限」も一般化不可。
3. queue/event integrationはduplicateを前提にする。AWS Lambda+SQSはat-least-onceでduplicate processingを明記しているため、AI call・billing・email送信・DB mutation等のside effectはidempotency key、deduplication record、outbox/transaction boundaryが必要。
4. GPU serverlessは実在するがavailability gateが強い。Cloud Run GPUはscale-to-zero可能で、L4/RTX PRO 6000 Blackwellをmanagedで提供する一方、GPU type、region、CPU/RAM minimum、one-GPU-per-instance等の制約がある。GPU availabilityをCPU serverlessと同等に扱わない。
5. cold startだけでなくmodel initialization、weight download、tokenizer/runtime initialization、network path、upstream model rate limitを別々に測る必要がある。platform instance startup値をend-to-end TTFT保証へ外挿しない。

## LIMITS / COUNTEREVIDENCE / FAILURE ENVELOPE
- function timeout前にupstream model callが長引けばpartial work/duplicate retryが起こり得る。
- queue redeliveryは障害ではなくdelivery semanticsの一部。handler非idempotentなら二重課金・二重通知・二重mutationになり得る。
- scale-to-zeroはidle costを下げる一方、cold path latencyを増やし得る。
- GPU startup約5秒というCloud Run値はcontainer内model readiness/weight load/TTFTを保証しない。
- serverless providerのquota、concurrency、region、GPU inventory、network egress、secret/IAM設定はtenantごとに異なる。
- long-running agentを単一request/function invocationへ閉じ込めるとtimeout・retry・checkpoint lossが増える。durable workflow/state machineへ分解すべきケースがある。

## AVAILABILITY_GATES
provider / region / hosting plan / runtime generation / trigger type / timeout / concurrency quota / queue semantics / GPU type and inventory / CPU-memory minimum / VPC-network path / model endpoint region / secret manager and IAM / payload size / retry-DLQ policy / pricing revision。

## IMPLEMENTATION_STATE
VERIFIED_SPEC: Lambda+SQS、Cloud Run services/jobs/GPU、Azure Functionsで実装可能な構成要素を確認。PROPOSAL: 将来Coreに `SERVERLESS_AI_EXECUTION_CONTRACT` を置く。fields: event_id/idempotency_key, trigger/source, queue/topic, payload hash/schema, function/container image digest, runtime revision, timeout, retry/backoff, DLQ, model endpoint/model ID, request hash, response artifact, durable checkpoint, side-effect commit key, region, concurrency, cold/warm marker, latency breakdown, cost attribution, audit trace。

## BENCHMARK_OR_EVAL
TEST_PROFILE（未実施）: warm/cold、single/burst、duplicate event、upstream 429/5xx、timeout直前response、poison message、partial batch failure、DLQ replay、model endpoint latency spike、GPU scale-from-zeroを固定fixture化。p50/p95/p99 end-to-end latency、cold-start contribution、duplicate side-effect rate、retry amplification、DLQ rate、success after retry、cost/request、idle cost、model-ready time、audit completenessを分離計測する。

## SECURITY / PRIVACY / AUDIT / COST / OPERABILITY
Security: least-privilege service identity、secret manager、private egress/VPC要否、webhook/event authenticity、payload classificationを別管理。Privacy: queue/log/DLQにpromptやPIIが残る可能性をretention対象化。Audit: event→invocation→model request→side effectをtrace/idempotency keyで結ぶ。Cost: function/container computeだけでなくqueue、egress、model tokens、GPU startup/idle、retry amplificationを含める。Operability: DLQ replay、rollback、quota exhaustion、region failoverをrunbook化。

## SAFE_WORDING_FOR_FUTURE_BOOK
「Serverless AIは、小規模・断続的・event-drivenなAI処理で常時稼働基盤を減らせる有力な実装形である。ただし実行時間、再試行、重複配送、quota、GPU/region、cold pathはproviderごとに異なる。外部side effectを伴う処理ではdurable stateとidempotencyを設計契約に含める。」

## UPDATE_WORK_HANDOFF
1. provider mapping時にAWS Lambda/SQS、Google Cloud Run/Tasks/Pub/Sub、Azure Functions/Service Bus等を同一比較軸へmapする。
2. pricing・quota・GPU region/typeは公開後更新時に再pinする。
3. EA-085 Event-driven AIのEVENT_TO_ACTION_CONTRACTと重複統合せず、EA-086はexecution substrate/cost/timeout/cold pathを担当する。
4. long-running agent/workflowはDurable Functions/Step Functions/Workflows等のdurable orchestrationを別subsectionで追加採集する。

## OPEN_UNKNOWN
2026-09-16時点の各provider exact price/concurrency quota、Cloud Run GPUの全region inventory、Azure Flex Consumptionのtenant別availability、AWS Lambda Managed Instancesの全適用条件。STOP_CONDITION: execution semantics、duplicate/retry boundary、GPU serverless availability gate、safe architecture contractが一次資料で確立したためEA-086の初回bounded packetは完了。価格/region/quotaは公開後Workで再確認する。


---

---

NEXT: /agent/start.json
STOP: This is a knowledge projection, not an execution order.