diff --git a/profiles/sets/coding/agents/opencode.nix b/profiles/sets/coding/agents/opencode.nix index 4c7ce45..bd4874c 100644 --- a/profiles/sets/coding/agents/opencode.nix +++ b/profiles/sets/coding/agents/opencode.nix @@ -168,6 +168,38 @@ # AZ-Gruppe LiteLLM endpoint + available models provider = { + # Z.AI GLM Coding Plan (flat-rate subscription). + # OpenAI-compatible endpoint; API key from the z.ai console is + # injected via {env:...} so it never lands in the store. Consumed by + # interactive opencode2 sessions (shell env) and by agents spawned + # through Paperclip's opencode harness (service EnvironmentFile). + zai-coding-plan = { + npm = "@ai-sdk/openai-compatible"; + name = "Z.AI Coding Plan"; + options = { + baseURL = "https://api.z.ai/api/coding/paas/v4"; + apiKey = "{env:ZAI_API_KEY}"; + }; + models = { + # Primary worker: 1M ctx flat-rate model. + "glm-5.3" = { + name = "GLM-5.3"; + limit = { + context = 1000000; + output = 128000; + }; + }; + # High-volume parallel scans: speed-tuned GLM on flat rate. + "glm-5-turbo" = { + name = "GLM-5 Turbo"; + limit = { + context = 200000; + output = 128000; + }; + }; + }; + }; + litellm = { npm = "@ai-sdk/openai-compatible"; name = "LiteLLM (AZ-Gruppe)"; diff --git a/profiles/sets/coding/agents/paperclip.nix b/profiles/sets/coding/agents/paperclip.nix index cefd268..79d861e 100644 --- a/profiles/sets/coding/agents/paperclip.nix +++ b/profiles/sets/coding/agents/paperclip.nix @@ -40,6 +40,10 @@ "PAPERCLIP_INSTANCE_ID=default" "PAPERCLIP_HOME=%h/.paperclip" ]; + # Optional per-user env file (e.g. ZAI_API_KEY for the GLM coding + # plan) — inherited by agent harnesses spawned from the service. + # Leading '-' keeps the unit working when the file is absent. + EnvironmentFile = "-%h/.config/paperclip.env"; WorkingDirectory = "%h"; Restart = "always"; RestartSec = 5;