Skip to content

[Feature] Make RAG UPLOAD_EXTS configurable via environment variable #11385

Closed

Description

@koutsenko

Description

It would be useful to make the list of file extensions indexed by linked folders configurable through an environment variable.

Currently, studio/backend/core/rag/config.py defines:

UPLOAD_EXTS = {".pdf", ".txt", ".md", ".markdown", ".docx", ".html", ".htm"}

while most of the other RAG settings in the same file are configurable through environment variables. The module docstring also says:

"""RAG config; every value is env-overridable."""

For example, I have a linked folder containing a large notes repository, but I only want Unsloth Studio to index Markdown files. Currently the only way to achieve this is to modify the installed config.py manually:

UPLOAD_EXTS = {".md"}

This works, but the change can be overwritten when Unsloth Studio is updated.

Proposed solution

Add an environment variable such as:

RAG_UPLOAD_EXTS=.md,.markdown

For example:

UPLOAD_EXTS = {
    ext.strip().lower()
    for ext in os.environ.get(
        "RAG_UPLOAD_EXTS",
        ".pdf,.txt,.md,.markdown,.docx,.html,.htm",
    ).split(",")
    if ext.strip()
}

The current list could remain the default, so this would preserve existing behavior.

Use case

A linked folder may contain Markdown notes together with HTML, TXT, DOCX, exported files, or other supported documents.

Being able to restrict ingestion to:

RAG_UPLOAD_EXTS=.md

would avoid indexing unwanted files without requiring a separate mirror directory or modifications to the installed package.

Environment

  • Unsloth Studio Desktop
  • Windows
  • Linked Folder / Project Sources

Activity

  1. KashmirAwana commented on Sep 20, 2026

    @KashmirAwana

    Making the UPLOAD_EXTS configurable via an environment variable seems like a practical addition, especially since other RAG settings are already adjustable this way. It would help avoid manual changes that get overwritten with updates.

  2. aran-yogesh commented on Sep 22, 2026

    @aran-yogesh

    I'd like to take this. #10395 is also changing the extension lists in rag/config.py. Should RAG_UPLOAD_EXTS override UPLOAD_EXTS now, or should I wait for #10395 and have it apply to ALL_UPLOAD_EXTS? The current list stays the default either way.

  3. Souravrajvi0 commented on Sep 22, 2026

    @Souravrajvi0
    Contributor

    Opened #11499 with RAG_UPLOAD_EXTS support on current main (defaults unchanged).

  4. KashmirAwana commented on Sep 27, 2026

    @KashmirAwana

    Looks like Sourav already opened a PR for this. You might want to coordinate with them on how it aligns with #10395.

  5. added a commit that references this issue on Oct 1, 2026
    a7a7c3c
  6. added a commit that references this issue on Oct 1, 2026
    38ef21f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions