# Customizing chunk size for file\_search tool

**URL:** <https://community.openai.com/t/customizing-chunk-size-for-file-search-tool/1148708>\
**Category:** API\
**Tags:** api, assistants-api\
**Created:** [March 21, 2025, 12:10pm UTC](https://community.openai.com/t/customizing-chunk-size-for-file-search-tool/1148708 "2025-03-21T12:10:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![macok](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/macok/32/511844_2.png) [@macok](https://community.openai.com/u/macok)\
**Post date:** [March 21, 2025, 12:10pm UTC](https://community.openai.com/t/customizing-chunk-size-for-file-search-tool/1148708/1 "2025-03-21T12:10:18Z")

</div>

From the docs: [https://platform.openai.com/docs/assistants/tools/file-search](https://platform.openai.com/docs/assistants/tools/file-search)

> By default, the `file_search` tool uses the following settings but these can be configured to suit your needs:
> 
> - Chunk size: 800 tokens
> - Chunk overlap: 400 tokens
> - Embedding model: `text-embedding-3-large` at 256 dimensions
> - Maximum number of chunks added to context: 20 (could be fewer)
> - Ranker: `auto` (OpenAI will choose which ranker to use)
> - Score threshold: 0 minimum ranking score

I’m currently creating thread like below:

```auto
thread = openai.beta.threads.create(
        messages=[
            {
                "role": "user",
                "content": final_query,
                "attachments": [
                    {"file_id": file_id, "tools": [{"type": "file_search"}]}
                    for file_id in file_ids
                ],
            }
        ]
    )

```

Can you help me change parameters like chunk size, embedding model etc.?  
I can’t find any docs on that.

---

<div class="post-metadata">

**Author:** ![\_j](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/_j/32/766292_2.png) [@\_j](https://community.openai.com/u/_j)\
**Post date:** [March 21, 2025, 1:15pm UTC](https://community.openai.com/t/customizing-chunk-size-for-file-search-tool/1148708/2 "2025-03-21T13:15:21Z")

</div>

You can do it when you create a new vector store:

```auto
vector_store = client.vector_stores.create(
    name="crazybase",
    file_ids=file_id_list,
    expires_after={
      "anchor": "last_active_at",
      "days": 60,
    },
    chunking_strategy={ # optional, default is 800, 400
        "type": "static",
        "static": {
            "max_chunk_size_tokens": 600,
            "chunk_overlap_tokens": 200,
        }
    }
)

```

You’d need to use that as a thread vector store

```auto
client.beta.threads.update(
    "thread_abc123",
    tool_resources={"file_search": {"vector_store_ids": [vector_store.id]}},
)

```

Any new files should follow the chunking property of the vector store.
