Commit Graph

16 Commits

Author SHA1 Message Date
Виталий Никитенко
41c5cf9b10 feat(eltex): three proxy models in /model, anth-glm-5.3 by default
Admins now give every key three models. ai-eltex maps them to the
picker slots:
- opus (default): anth-glm-5.3 - glm-5.3 on the Z.ai Anthropic
  endpoint: images via analyze_image, effort works, 1M window;
- sonnet: zai-glm-5.3 - glm-5.3 on the OpenAI endpoint, no images or
  effort, 200K. Two keys get it as zai-glm-5.3-2-2 (zai-glm-5.3 is 403
  for them), so the name is matched exactly or by prefix;
- haiku: zai-glm-5.3-flash - fast, sees images itself, no effort,
  200K; Claude Code also uses this slot for background tasks.
A missing zai/flash model falls back to the default one.

Model name is anth-glm-5.3 again: with anth-glm-5.3-5 the auto-logout
would drop every saved key, since no key has that name now.

Context window is per model instead of a global
CLAUDE_CODE_MAX_CONTEXT_TOKENS=1000000: [1m] only on anth-glm-5.3
(Claude Code strips the suffix before the API call), 200K for the
others, otherwise a long flash/zai session would hit "Prompt exceeds
max length" instead of auto-compacting.

Checked on all 6 pilot keys (19.10): default model reads a png via
Read + analyze_image; sonnet/haiku answer with 200K windows; effort
low on anth-glm-5.3 = 68 output tokens (max ~3500).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 11:51:04 +07:00
Виталий Никитенко
ef187a1b48 feat(glm): default effort xhigh instead of max
Z.ai maps xhigh to native high, so this trims the thinking budget for
everyday ai-glm launches; AI_EFFORT=max still forces the old behavior.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-10-16 06:51:52 +03:00
Виталий Никитенко
e6fe58eb37 feat(mimo): add ai-mimo launcher for Xiaomi MiMo V2.6 Pro
ai-mimo runs Claude Code through Xiaomi's Anthropic-compatible API
(Token Plan or pay-as-you-go). The key's endpoint is found by probing
token-plan-sgp, token-plan-ams and api.xiaomimimo.com (a key only works
in its own region) and is saved to mimo_base_url; MIMO_BASE_URL
overrides. Unreachable endpoints are skipped, token-plan-cn is left out
of the probe since it times out from our network, and a 402 on the
pay-as-you-go endpoint explains that a tp- Token Plan key is needed.

Always the smartest model: mimo-v2.6-pro in every slot and for
subagents, --model opus and --effort max on each start, 128000 output
tokens (Claude Code's ceiling), real 1M context window. Measured on
13.10: MiMo ignores output_config.effort (even "bogus" is accepted, no
length trend from low to max) and treats thinking adaptive like
enabled, so reasoning is always on; EFFORT_MAPPING.md records this.

/logout-mimo is registered as a command and handled by the logout hook
(removes mimo_key and mimo_base_url). setup.sh status, statusline brand
color, README, QUICK_START and AGENTS.md list the new launcher.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 15:43:25 +07:00
Виталий Никитенко
6c507b4549 feat(eltex): add ai-eltex-qwen, effort max by default; fix model pick and /logout-eltex
ai-eltex-qwen: new launcher for the Eltex proxy on Qwen models
(Coder-Senior, then Flash-Next), own key eltex_qwen_key, config dir and
/logout-eltex-qwen hook branch, 200K window.

Effort: ai-glm and ai-eltex start on max via CLI --effort (AI_EFFORT
overrides), CLAUDE_CODE_MAX_OUTPUT_TOKENS=64000 so long GLM answers are
not cut at 32000. EFFORT_MAPPING notes the proxy passes effort for
anth-glm-5.3 since 09.10.

ai-eltex model pick: no longer falls back to the first /v1/models entry,
which twice picked something unusable (zai-glm-5.3 routed to flash, and
the access-group name ZAI-Test-Group -> 400). Without anth-glm-5.3 the
launcher exits with a clear message; ELTEX_MODEL still overrides.

/logout-eltex: Claude Code answered "Unknown command" and never called
the logout hook (the built-in /logout bypasses hooks too). ai-eltex now
registers commands/logout-eltex.md in its config dir, so the hook
receives the command and deletes eltex_key (checked end to end).

ru-bypass: resolve exception hosts via ahostsv4 first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 11:52:45 +07:00
Виталий Никитенко
083a614940 feat(eltex): add ai-eltex launcher for corporate LLM proxy
ai-eltex runs Claude Code through the Eltex LiteLLM proxy
(http://llm.eltex.loc:4000, team GLM subscription). The personal key
from admins is checked via /v1/models and stored in
~/.config/ai-setup/eltex_key; the model is taken from the key's
allowed list (ELTEX_MODEL / ELTEX_BASE_URL override). The proxy
ignores effort/thinking, so no effort forcing. /logout-eltex and
/logout in ai-eltex drop the key; setup.sh status shows it.

ru-bypass: hosts block now has an end marker and only that block is
rewritten, manual entries outside it survive; llm.eltex.loc/llm2 added
since the VPN DNS does not resolve it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 12:21:02 +07:00
Виталий Никитенко
08ad4bb429 fix(glm): default effort xhigh, document real GLM 5.3 effort mapping
Z.ai Anthropic endpoint reads output_config.effort and accepts all 5
Claude Code levels, but GLM 5.3 has only low/high/max natively:
medium -> low, xhigh -> high (measured, not documented by Z.ai).
ai-glm now starts on xhigh instead of max.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 10:49:02 +07:00
Виталий Никитенко
676b25217e docs(effort): DeepSeek V4 has 3 native effort levels
low->low, medium/xhigh->high, max->max on the DeepSeek API side.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-21 15:41:59 +03:00
Виталий Никитенко
f61f2cde84 feat(glm): switch ai-glm to GLM 5.3
glm-5.3 доступна на api.z.ai (вышла 2026-08-14, 1M контекст): opus/sonnet =
glm-5.3, haiku = glm-5.3[1m], subagent = glm-5.3, health-check ключа тоже
на 5.3. Секция OpenRouter остаётся на z-ai/glm-5.2 — там 5.3 ещё нет.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-17 06:00:11 +03:00
Виталий Никитенко
9b906823cd feat: добавить ai-cursor лаунчер (нативный Cursor CLI agent)
Генерация нативного лаунчера ai-cursor для Cursor CLI (agent) с
автоустановкой через cursor.com/install, интеграцией proxychains4 в
VLESS-режиме, обновлением ~/.cursorrules и флагом --force (--yolo).
Очистка старого ai-cursor из ~/.local/bin при нестандартном BIN_DIR.
Добавлены тест генерации и упоминания в EFFORT_MAPPING/QUICK_START/README.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-30 09:27:02 +03:00
Виталий Никитенко
a74597dba6 feat: добавить ai-opencode лаунчер (OpenCode Go + routatic-proxy)
- Новый лаунчер ai-opencode с routatic-proxy на 127.0.0.1:3456
- Автоустановка routatic-proxy под linux/darwin amd64/arm64
- Модели: deepseek-v4-pro (opus/sonnet), kimi-k2.6 (haiku)
- AI_RESET_KEY, OPENCODE_GO_API_KEY env fallback, управление opencode_key
- Документация: EFFORT_MAPPING.md, QUICK_START.md, README.md
- Статус-проверка в setup.sh: ai-opencode, opencode_key, opencode.ai
- Тесты: 4 новых теста для ai-opencode в test_fixes.sh

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-23 08:41:38 +03:00
Виталий Никитенко
83a7790235 feat: добавить ai-glm - лаунчер Claude Code через Zhipu AI GLM 5.2
Новый лаунчер ai-glm запускает Claude Code через официальный Anthropic-совместимый
API Zhipu AI (api.z.ai). Модели: glm-5.2 (opus/sonnet), glm-5.2[1m] (haiku).
Обновлены документация, статус, тесты и EFFORT_MAPPING.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-19 06:41:41 +03:00
1cb4853dca refactor: нативный persistence effort, выпил мёртвого кэша effort_*
EFFORT_MAPPING, statusline и _apply_effort переведены на нативное
хранение уровня в settings.json лаунчера. Убран CLAUDE_CODE_EFFORT_LEVEL
(он блокировал /effort внутри сессии) и кэш ~/.cache/ai-setup/effort_*,
который никто не читал и который врал относительно реального уровня.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 05:21:12 +03:00
38b5f2710c docs: sync README/QUICK_START/EFFORT_MAPPING with current code
- Update ai-openrouter models in ai-setup.sh output and header
- Fix effort persistence wording (statusbar -> launcher)
- Unify KS_EXCEPTIONS -> KILL_SWITCH_EXCEPTIONS in docs and setup.sh prompt
- Clarify menu item 7 only updates AI launchers
- Add IPv6 note after ks-off.sh
- Scope UFW before.rules insertion to *filter section

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-14 09:16:37 +03:00
6c2844ce92 feat: добавить поддержку Kimi K2.7 Code в ai-kimi
- Opus/Sonnet: kimi-k2.7 (флагманский программист)
- Haiku/Subagent: kimi-k2.6 (быстрый универсал)
- Проверка ключа тестирует kimi-k2.7
- Обновлён EFFORT_MAPPING.md и тесты

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-12 21:42:28 +03:00
f8465580e0 feat: полная изоляция моделей между ai-* и гибридный persistence effort
Раньше все ai-* лаунчеры делили один ~/.claude и общий settings.json, из-за
чего кастомная модель (openai/gpt-5.5) из ai-openrouter протекала в пикер
ai-claude. Теперь каждый сторонний провайдер изолирован в своём
CLAUDE_CONFIG_DIR (~/.config/ai-setup/cfg/<launcher>) - свои settings.json и
.claude.json, ноль протечек. ai-claude остаётся на ~/.claude (нативный логин).

Пикеры /model приведены к требуемому виду:
- ai-deepseek: только DeepSeek V4 Pro (opus) и DeepSeek V4 Flash (haiku),
  дефолт Pro; через availableModels + ANTHROPIC_DEFAULT_*_MODEL_NAME
- ai-kimi: только Kimi K2.6 (opus)
- ai-claude: только нативные модели Claude
Общие skills и CLAUDE.md шарятся симлинком из ~/.claude.

Persistence effort - гибрид:
- low/medium/high/xhigh живут нативно в settings.json лаунчера, /effort
  внутри сессии работает свободно и уровень сохраняется
- max нельзя сохранить в settings.json (session-only), поэтому он
  восстанавливается через CLAUDE_CODE_EFFORT_LEVEL; в такой max-сессии
  /effort залочен (ограничение Claude Code), выход - AI_EFFORT=<lvl> ai-*
Текущий уровень ловит статусбар в ~/.cache/ai-setup/effort_<launcher>.

Удалён устаревший effort-save-hook (заменён нативным persistence + гибридом),
почищен из ~/.claude/settings.json и осиротевший кэш model_*.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-12 07:33:30 +03:00
78556245ef fix: effort-proxy mapping max→xhigh for GPT, add EFFORT_MAPPING.md
- Fix effort-proxy direction: GPT-5.5 natively supports xhigh but not max,
  so map max→xhigh (was incorrectly xhigh→max)
- Add EFFORT_MAPPING.md with full mapping table for all providers:
  Anthropic, GPT-5.5, DeepSeek V4, Kimi K2.6, Gemini 3.x
- Update proxy docstring and comments
2026-05-31 13:09:41 +07:00