Batches: OpenAI's Files and Batch APIs, served at the lowest priority under a store lease, each line a request of the key that made it

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ilker ManapandClaude Opus 5.5 committed 2026-10-04 21:00:01 +02:00
1 parent 889be70b8f
commit 841ee21c12
19 files changed
+1775 -10

No files matched your search

+20
View File
@@ -453,6 +453,11 @@ type Router struct {
// MaxBodyBytes bounds the request body the router will read.
MaxBodyBytes int64 `koanf:"max_body_bytes"`
// Batch is the Files and Batch APIs (/v1/files, /v1/batches): a file of
// requests served at the lowest priority, its answers written to
// another. Needs the store.
Batch Batch `koanf:"batch"`
// TrustedProxies are the reverse proxies in front of the client port,
// as addresses or CIDR prefixes. Their X-Forwarded-For, -Proto and -Host
// are believed; anyone else's are not, since they decide the address
@@ -553,6 +558,21 @@ type Endpoint struct {
Priority int `koanf:"priority"`
}
// Batch is how the Files and Batch APIs are bounded.
type Batch struct {
// MaxFileBytes bounds one uploaded file; 100 MB unless set.
MaxFileBytes int64 `koanf:"max_file_bytes"`
// MaxLines bounds the requests in one batch; 50 000 unless set.
MaxLines int `koanf:"max_lines"`
// Concurrency is how many of one batch's requests are in flight at
// once; 4 unless set. They queue in the lowest admission band, behind
// every interactive request.
Concurrency int `koanf:"concurrency"`
// RetainDays is how long a batch's answer and error files are kept;
// 30 unless set. Uploaded files are kept until deleted.
RetainDays int `koanf:"retain_days"`
}
// Default returns the configuration used when nothing is specified.
func Default() Server {
return Server{