Skip to content

[Enhancement]: Return signed URLs for S3/CloudFront file downloads instead of proxying #11998

@AtefBellaaj

Description

@AtefBellaaj

What features would you like to see added?

Return a pre-signed URL instead of proxying file content (seen in File Citation). The client would then download directly from S3/CloudFront.

Benefits:

  • Reduced API server bandwidth and CPU/memory usage
  • Leverage CDN edge caching (CloudFront) when the feature comes to Librechat
  • Faster downloads (direct connection)

More details

Currently, file downloads for citations (S3/CloudFront) are proxied through the LibreChat API server:

  1. Client requests file download from LibreChat API
  2. API fetches file content from S3/CloudFront (GetObjectCommand)
  3. API pipes the stream back to client

This adds unnecessary load on the API server, especially for large files or high traffic.

Which components are impacted by your request?

Endpoints, General

Pictures

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions