npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@letta-ai/model-profiles

v0.1.0

Published

Letta Code mod package for managing per-model context window and reasoning effort profiles in MemFS.

Readme

@letta-ai/model-profiles

Letta Code mod that remembers a preferred context window limit and reasoning effort for each model, and applies them in the same update when you switch to that model.

Why

Context window and reasoning settings are per-model. When you switch models, the new model starts from its own defaults, not from whatever you had tuned on the previous one. If you want Grok capped at 250,000 tokens, or a specific model always on xhigh reasoning, you have to set that again after every switch.

This mod stores those preferences as a profile per model handle and applies model, context window, and reasoning effort together through ctx.conversation.updateLlmConfig.

Install

Recommended: install as an agent-scoped mod in MemFS so the mod and its profiles travel with the agent.

mkdir -p "$MEMORY_DIR/mods"
cp packages/model-profiles/mods/index.ts "$MEMORY_DIR/mods/model-profiles.ts"

Then run /reload in Letta Code.

Agent scope means:

  • each agent keeps its own profiles
  • profiles live in the agent's memory git repository and follow it across machines
  • --scope agent changes only this agent's default, never a global setting

You can also install it as a normal package with letta install npm:@letta-ai/model-profiles. Profiles are still stored per agent in MemFS when MemFS is enabled.

Storage

Profiles are written to $MEMORY_DIR/mods/model-profiles.json (an existing file at $MEMORY_DIR/model-profiles.json is kept in place). Without MemFS or MEMORY_DIR, the file lives at ~/.letta/mods/model-profiles.json.

Writes go to a temporary file and are renamed into place, so an interrupted write cannot leave a half-written file. If the file is ever unreadable, it is moved to model-profiles.json.corrupt-<timestamp> and a warning is reported, rather than being overwritten. Nothing is committed or pushed by the mod.

Slash command

/model-profile list
/model-profile set <model> <context-window> [reasoning] [label...]
/model-profile switch <model-or-label...> [--scope conversation|agent]
/model-profile remove <model-or-label...>
  • reasoning is one of none, minimal, low, medium, high, xhigh, max.
  • Labels can contain spaces and are matched case-insensitively.
  • --scope accepts --scope agent, --scope=agent, or the shorthand --agent. It may appear anywhere in the command.

Example:

/model-profile set xai/grok-4-6 250000 xhigh Grok 4.6
/model-profile switch Grok 4.6
/model-profile switch anthropic/claude-opus-4-8 --scope agent

If no profile matches, the model is still switched and the output says that provider defaults were used for anything not saved.

Tools

The agent can call the same operations:

  • list_model_profiles - saved profiles plus the current model, context window, and reasoning effort
  • set_model_profile - model, context_window, optional reasoning_effort, optional label
  • switch_model_profile - model (handle or label), optional scope, optional context_window and reasoning_effort overrides that win over the saved profile
  • delete_model_profile - model (handle or label)

list_model_profiles is parallel-safe. The three tools that write or switch are not, so the runtime serialises them.

Scope

  • conversation (default): changes the active conversation only. The agent default is untouched.
  • agent: changes the agent's default configuration.

Changes take effect on the next turn.

Test

npm test