# MEF Documentation

**URL:** <https://forum.modular.com/t/mef-documentation/2185>\
**Category:** MAX\
**Created:** [August 25, 2025, 7:20pm UTC](https://forum.modular.com/t/mef-documentation/2185 "2025-08-25T19:20:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![marshy](https://avatars.discourse-cdn.com/v4/letter/m/b5a626/32.png) [@marshy](https://forum.modular.com/u/marshy)\
**Post date:** [August 25, 2025, 7:20pm UTC](https://forum.modular.com/t/mef-documentation/2185/1 "2025-08-25T19:20:22Z")

</div>

I have been using a combination of modal + modular to do some custom inference work for a bit, but I’ve been having issues persisting the compiled execution graphs to my serverless environment.

After doing some digging on my local macOS env, i managed to find the file path where the MEF files are stored, (/Users/{username}/.local/share/modular/.max\_cache/mof/mef) then I just manually set the volume to be what i expected the path would be on my linux env(/root/.local/share/modular/.max\_cache/mof/mef). That seems to have worked (no more slow building + compiling on boot).

However, it would be great to get deeper documentation on the MEF paradigm as a whole. Took longer than it should have to get things working.

---

<div class="post-metadata">

**Author:** ![joshpeterson](https://sea1.discourse-cdn.com/flex001/user_avatar/forum.modular.com/joshpeterson/32/14_2.png) [@joshpeterson](https://forum.modular.com/u/joshpeterson)\
**Post date:** [August 26, 2025, 12:52pm UTC](https://forum.modular.com/t/mef-documentation/2185/2 "2025-08-26T12:52:23Z")

</div>

So _generally_ the MEF location is controlled by the `modular.cfg`. in particular:

```yaml
[max]
cache_dir = <path>

```

In conda world, we set that to be inside the environment:

```bash
cache_dir = $ENV/share/max/.max_cache

```

You can also override with `MODULAR_MAX_CACHE_DIR` like we do in the `mojo` entrypoint script in Python world: [modular/mojo/python/mojo/run.py at main · modular/modular · GitHub](https://github.com/modular/modular/blob/main/mojo/python/mojo/run.py#L48)

```python
"MODULAR_MAX_CACHE_DIR": str(root / "share" / "max" / ".max_cache"),

```

---

<div class="post-metadata">

**Author:** ![Ehsan](https://sea1.discourse-cdn.com/flex001/user_avatar/forum.modular.com/ehsan/32/142_2.png) [@Ehsan](https://forum.modular.com/u/Ehsan)\
**Post date:** [August 26, 2025, 1:10pm UTC](https://forum.modular.com/t/mef-documentation/2185/3 "2025-08-26T13:10:48Z")

</div>

Caveat is the cache may not be work in the serverless env such as modal that users don’t have control over the CPU arch.

---

<div class="post-metadata">

**Author:** ![marshy](https://avatars.discourse-cdn.com/v4/letter/m/b5a626/32.png) [@marshy](https://forum.modular.com/u/marshy)\
**Post date:** [August 26, 2025, 1:38pm UTC](https://forum.modular.com/t/mef-documentation/2185/4 "2025-08-26T13:38:31Z")

</div>

makes sense. Beyond my current strategy, which seems to be holding up for now, is there anything on the roadmap to make the caching simpler across diff archs? I know there isn’t MEF portability at the moment, but I’m surprised to see a technical choice that is CPU arch dependent. That is rare ime

---

<div class="post-metadata">

**Author:** ![joshpeterson](https://sea1.discourse-cdn.com/flex001/user_avatar/forum.modular.com/joshpeterson/32/14_2.png) [@joshpeterson](https://forum.modular.com/u/joshpeterson)\
**Post date:** [August 27, 2025, 11:51am UTC](https://forum.modular.com/t/mef-documentation/2185/5 "2025-08-27T11:51:49Z")

</div>

No, we don’t have any near term plans to change this. I agree, the current behavior is not ideal though. I suspect we will improve it at some point, but this is not a target feature we expect to work on soon.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex001/uploads/modular/original/1X/2751e0fbdc595a99718b216730957e9db4448cfd.jpeg) [@system](https://forum.modular.com/u/system)\
**Post date:** [February 23, 2026, 11:51am UTC](https://forum.modular.com/t/mef-documentation/2185/6 "2026-02-23T11:51:53Z")

</div>

Closed on February 23, 2026, 11:51am UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
