Skip to content

Serve provider-native Files in standalone mode #1377

Description

@HareeshBahuleyan

Desired behavior

Standalone mode serves the same provider-native Files API that #1185 adds for hybrid: upload, list, retrieve, download, and delete files at Anthropic or OpenAI through the official SDKs, and reference them from Anthropic Messages. Bytes stay at the provider; the local database holds ownership, quotas, and the cleanup queue.

Why

#1185 gates hybrid_files.router on is_hybrid_mode, so a standalone deployment with an Anthropic or OpenAI key cannot use container_upload or persistent provider files. It has to inline the file on every request through the local /api/v1/files extraction path instead.

The core is already mode-neutral: ProviderFileService, create_provider_files_router, the any-llm transport, the envelope adapters, and migration c3e5a7b9d1f4 all land in standalone too. What is missing is the wiring:

  • Standalone authenticate / authenticate_gateway / authorize_attempt callbacks for create_provider_files_router, resolving the local API key to a FileScope.
  • A local account resolver that mints ProviderAccountGeneration rows from provider_credentials and puts provider_account_generation_id on standalone attempts.
  • An in-process sibling of PlatformFilesClient so hybrid_files.py can reach ProviderFileService without the HTTP hop, and an in-process cleanup executor in the standalone lifespan.

Notes

Ref: #984

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area/apiAPI design and behaviorarea/backendBackend service implementationenhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions