mirror of
https://github.com/thegeneralist01/config.git
synced 2026-12-04 18:56:56 +01:00
Manage OMP model routing declaratively
This commit is contained in:
parent
e6b7632401
commit
21703da739
6 changed files with 114 additions and 23 deletions
|
|
@ -168,6 +168,24 @@ Located in `modules/common/`, these are loaded on all systems:
|
||||||
- `git.nix`, `neovim.nix`, `zsh.nix` - Development tools
|
- `git.nix`, `neovim.nix`, `zsh.nix` - Development tools
|
||||||
- `agenix.nix` - Secret management
|
- `agenix.nix` - Secret management
|
||||||
|
|
||||||
|
### OMP model routing
|
||||||
|
|
||||||
|
`modules/dotfiles/omp/models.nix` declares OMP's model roles, per-agent model
|
||||||
|
overrides, and saved presets. `modules/common/omp.nix` applies them during Home
|
||||||
|
Manager activation, alongside the custom agent definitions and prompts.
|
||||||
|
|
||||||
|
The activation replaces `modelRoles`, `task.agentModelOverrides`, and
|
||||||
|
`modelPresets` in `~/.omp/agent/config.yml`. Other settings, including other
|
||||||
|
`task` options, are preserved. The file remains writable: changes saved through
|
||||||
|
OMP work immediately, but the next rebuild restores these three repo-owned
|
||||||
|
sections. Edit `models.nix` to make routing changes permanent across rebuilds.
|
||||||
|
|
||||||
|
The `gemmysolopus`, `haikugemmyopus`, and `aura` presets retain their different
|
||||||
|
default/small models, while sharing Gemini Flash Medium for tasks and Opus 5.5
|
||||||
|
High for planning. Per-agent overrides keep both reviewers on Sol High and
|
||||||
|
`l-worker` on Sol independently of the selected preset. Selecting a preset or
|
||||||
|
changing the active session model remains an OMP action, not a rebuild action.
|
||||||
|
|
||||||
### Platform-Specific Modules
|
### Platform-Specific Modules
|
||||||
- `modules/darwin/` - macOS-specific (SSH, Karabiner, packages)
|
- `modules/darwin/` - macOS-specific (SSH, Karabiner, packages)
|
||||||
- `modules/linux/` - Linux-specific (boot, networking, X11, NVIDIA)
|
- `modules/linux/` - Linux-specific (boot, networking, X11, NVIDIA)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
{ lib, ... }:
|
{ lib, pkgs, ... }:
|
||||||
let
|
let
|
||||||
inherit (lib)
|
inherit (lib)
|
||||||
filterAttrs
|
filterAttrs
|
||||||
|
|
@ -7,6 +7,9 @@ let
|
||||||
;
|
;
|
||||||
|
|
||||||
ompDotfiles = ../dotfiles/omp;
|
ompDotfiles = ../dotfiles/omp;
|
||||||
|
modelSettings = pkgs.writeText "omp-models.json" (
|
||||||
|
builtins.toJSON (import (ompDotfiles + "/models.nix"))
|
||||||
|
);
|
||||||
|
|
||||||
# Only manage named files (force=true). Does NOT take over the whole agents/
|
# Only manage named files (force=true). Does NOT take over the whole agents/
|
||||||
# directory, so stock `omp agents unpack` files can coexist.
|
# directory, so stock `omp agents unpack` files can coexist.
|
||||||
|
|
@ -16,25 +19,50 @@ let
|
||||||
dir = ompDotfiles + "/${relDir}";
|
dir = ompDotfiles + "/${relDir}";
|
||||||
entries = filterAttrs (_: type: type == "regular") (builtins.readDir dir);
|
entries = filterAttrs (_: type: type == "regular") (builtins.readDir dir);
|
||||||
in
|
in
|
||||||
mapAttrs' (
|
mapAttrs'
|
||||||
name: _:
|
(
|
||||||
nameValuePair "${targetPrefix}/${name}" {
|
name: _:
|
||||||
source = dir + "/${name}";
|
nameValuePair "${targetPrefix}/${name}" {
|
||||||
force = true;
|
source = dir + "/${name}";
|
||||||
}
|
force = true;
|
||||||
) entries;
|
}
|
||||||
|
)
|
||||||
|
entries;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
home-manager.sharedModules = [
|
home-manager.sharedModules = [
|
||||||
{
|
(
|
||||||
home.file = {
|
{ lib, ... }:
|
||||||
".omp/agent/AGENTS.md" = {
|
{
|
||||||
source = ompDotfiles + "/AGENTS.md";
|
home.file = {
|
||||||
force = true;
|
".omp/agent/AGENTS.md" = {
|
||||||
};
|
source = ompDotfiles + "/AGENTS.md";
|
||||||
|
force = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
// filesFromDir "agents" ".omp/agent/agents"
|
||||||
|
// filesFromDir "prompts" ".omp/agent/prompts";
|
||||||
|
|
||||||
|
# OMP writes this file itself; replace only the repo-owned routing sections.
|
||||||
|
home.activation.ompModels = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||||
|
(
|
||||||
|
config="$HOME/.omp/agent/config.yml"
|
||||||
|
if [ -n "''${DRY_RUN:-}" ]; then
|
||||||
|
echo "Apply repo-managed OMP model routing to $config"
|
||||||
|
else
|
||||||
|
${pkgs.coreutils}/bin/install -d -m 700 "$HOME/.omp/agent"
|
||||||
|
if [ ! -e "$config" ]; then
|
||||||
|
${pkgs.coreutils}/bin/install -m 600 /dev/null "$config"
|
||||||
|
fi
|
||||||
|
${lib.getExe pkgs.yq-go} -i '
|
||||||
|
.modelRoles = load("${modelSettings}").modelRoles |
|
||||||
|
.task.agentModelOverrides = load("${modelSettings}").task.agentModelOverrides |
|
||||||
|
.modelPresets = load("${modelSettings}").modelPresets
|
||||||
|
' "$config"
|
||||||
|
fi
|
||||||
|
)
|
||||||
|
'';
|
||||||
}
|
}
|
||||||
// filesFromDir "agents" ".omp/agent/agents"
|
)
|
||||||
// filesFromDir "prompts" ".omp/agent/prompts";
|
|
||||||
}
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
---
|
---
|
||||||
name: l-planner
|
name: l-planner
|
||||||
description: "creates implementation plans from context; no edits."
|
description: "creates implementation plans using @plan at high effort; no edits."
|
||||||
tools:
|
tools:
|
||||||
- read
|
- read
|
||||||
- grep
|
- grep
|
||||||
- glob
|
- glob
|
||||||
model:
|
model:
|
||||||
- "@default"
|
- "@plan"
|
||||||
thinkingLevel: medium
|
thinkingLevel: high
|
||||||
---
|
---
|
||||||
|
|
||||||
You are a planning specialist. You receive context (from a scout) and requirements, then produce a clear implementation plan.
|
You are a planning specialist. You receive context (from a scout) and requirements, then produce a clear implementation plan.
|
||||||
|
|
|
||||||
|
|
@ -7,12 +7,14 @@ tools:
|
||||||
- glob
|
- glob
|
||||||
- bash
|
- bash
|
||||||
model:
|
model:
|
||||||
- "@default"
|
- "openai-codex/gpt-6.1-sol"
|
||||||
thinkingLevel: medium
|
thinkingLevel: high
|
||||||
---
|
---
|
||||||
|
|
||||||
You are a senior code reviewer. Analyze code for quality, security, and maintainability.
|
You are a senior code reviewer. Analyze code for quality, security, and maintainability.
|
||||||
|
|
||||||
|
Model routing: reviews use Sol at high effort independently of the orchestrator's active model.
|
||||||
|
|
||||||
Bash is for read-only commands only. Do NOT modify files, run builds, or run mutating VCS commands.
|
Bash is for read-only commands only. Do NOT modify files, run builds, or run mutating VCS commands.
|
||||||
Assume tool permissions are not perfectly enforceable; keep all bash usage strictly read-only.
|
Assume tool permissions are not perfectly enforceable; keep all bash usage strictly read-only.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,14 @@
|
||||||
name: l-worker
|
name: l-worker
|
||||||
description: "general-purpose implementer with full tools, isolated context."
|
description: "general-purpose implementer with full tools, isolated context."
|
||||||
model:
|
model:
|
||||||
- "@default"
|
- "openai-codex/gpt-6.1-sol"
|
||||||
thinkingLevel: auto
|
thinkingLevel: auto
|
||||||
---
|
---
|
||||||
|
|
||||||
You are a worker agent with full capabilities. You operate in an isolated context window to handle delegated tasks without polluting the main conversation.
|
You are a worker agent with full capabilities. You operate in an isolated context window to handle delegated tasks without polluting the main conversation.
|
||||||
|
|
||||||
|
Model routing: Sol is pinned independently of the orchestrator's active model.
|
||||||
|
|
||||||
Work autonomously to complete the assigned task. Use all available tools as needed.
|
Work autonomously to complete the assigned task. Use all available tools as needed.
|
||||||
|
|
||||||
Output format when finished:
|
Output format when finished:
|
||||||
|
|
|
||||||
41
modules/dotfiles/omp/models.nix
Normal file
41
modules/dotfiles/omp/models.nix
Normal file
|
|
@ -0,0 +1,41 @@
|
||||||
|
let
|
||||||
|
modelRoles = {
|
||||||
|
default = "openai-codex/gpt-6.1-sol:high";
|
||||||
|
smol = "google-antigravity/gemini-3.8-flash:medium";
|
||||||
|
slow = "anthropic/claude-opus-5-5:high";
|
||||||
|
plan = "anthropic/claude-opus-5-5:high";
|
||||||
|
task = "google-antigravity/gemini-3.8-flash:medium";
|
||||||
|
commit = "google-antigravity/gemini-3.8-flash:minimal";
|
||||||
|
advisor = "openai-codex/gpt-5.5:xhigh";
|
||||||
|
tiny = "openai-codex/gpt-5.4-mini:medium";
|
||||||
|
web = "web/exa";
|
||||||
|
speech = "xai-oauth/grok-tts";
|
||||||
|
};
|
||||||
|
|
||||||
|
preset = overrides: {
|
||||||
|
modelRoles = modelRoles // overrides;
|
||||||
|
defaultThinkingLevel = "auto";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
inherit modelRoles;
|
||||||
|
|
||||||
|
task.agentModelOverrides = {
|
||||||
|
l-worker = "openai-codex/gpt-6.1-sol";
|
||||||
|
l-reviewer = "openai-codex/gpt-6.1-sol:high";
|
||||||
|
l-planner = "@plan:high";
|
||||||
|
reviewer = "openai-codex/gpt-6.1-sol:high";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Presets share the task/plan roles so switching the main model cannot undo them.
|
||||||
|
modelPresets = {
|
||||||
|
gemmysolopus = preset { };
|
||||||
|
haikugemmyopus = preset {
|
||||||
|
smol = "anthropic/claude-haiku-4-5:medium";
|
||||||
|
default = "google-antigravity/gemini-3.8-flash";
|
||||||
|
};
|
||||||
|
aura = preset {
|
||||||
|
default = "anthropic/claude-opus-5-5:high";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue