Skip to content

feat(llm): add AbliteratedLLM OpenAI-compatible gateway - #1208

Closed
whiteworthy wants to merge 2 commits into
BitterSecurity:mainfrom
whiteworthy:add-abliteratedllm
Closed

whiteworthy wants to merge 2 commits into
BitterSecurity:mainfrom
whiteworthy:add-abliteratedllm

Conversation

@whiteworthy

@whiteworthy whiteworthy commented Nov 19, 2026 •

Copy link
Copy Markdown

Disclosure: I operate AbliteratedLLM.

Summary

Adds AbliteratedLLM (abliteratedllm_api) as a credentials-aware OpenAI-compatible gateway, following the #453 wiring and closing the static-route gap #985 fixed for Cheaper Inference. Setting ABLITERATEDLLM_API_KEY makes Decepticon resolve HIGH to abliteratedllm/glm-5.3-cyber-abliterated and MID/LOW to abliteratedllm/glm-5.3-flash-abliterated, registered in both build_model_entry() and the generated static config/litellm.yaml, so a key-only deployment does not 400 on its first call.

AbliteratedLLM serves GLM-5.3 weights edited to remove refusals, offered here for authorized security testing; under the provider's terms, users are solely responsible for their prompts, outputs and how they use them. No capability claim beyond the routes, limits and prices below is made.

Tier Alias Input / output / cached input per 1M tokens (USD)
HIGH abliteratedllm/glm-5.3-cyber-abliterated 0.90 / 1.80 / 0.135
MID, LOW abliteratedllm/glm-5.3-flash-abliterated 0.0977 / 0.3421 / 0.0098

Both ids, 1,048,576-token context and 131,072 max output tokens were read from the public GET https://api.abliteratedllm.dev/v1/models on 2026-11-19; that endpoint needs no key. Rates are stored as per-token costs including cache_read_input_token_cost, not $0 placeholders, so these routes are deliberately not added to middleware/budget.py::_SPEND_UNTRACKED_METHODS: a configured DECEPTICON_BUDGET__* cap remains measurable. A regression pins the non-zero prices and that budget admission.

Changes

  • model-catalog/catalog.json + overlay.json: two public routes (openai/<slug> + pinned https://api.abliteratedllm.dev/v1), the os.environ/ABLITERATEDLLM_API_KEY provider credential, and one in-gateway HIGH → Flash fallback. config/litellm.yaml, clients/cli/src/commands/currentProdModels.ts and configuredModelRoutes.ts are the generator's outputs (python model-catalog/generate.py), not hand edits; the drift check stays clean.
  • config/litellm_dynamic_config.py: OPENAI_COMPAT_GATEWAYS["abliteratedllm"], which also admits the prefix through ALLOWED_DYNAMIC_PROVIDERS and reuses the existing openai/ rewrite branch.
  • decepticon_core/types/llm.py: AuthMethod.ABLITERATEDLLM_API, METHOD_MODELS HIGH/MID/LOW matrix entry and the module routing table.
  • llm/factory.py: env detection, default fallback priority (after the other hosted gateways, before the generic opt-in gateway and local endpoints) and the decepticon-cli auth label. No key-prefix hint is pinned, so only the shared non-placeholder/minimum-length checks apply.
  • /model group, .env.example, docs/setup-guide.md row and tier/budget note, and a CHAGELOG.md Unreleased entry linking this PR.
  • Tests: gateway routing/validation, static route + real price + fallback shape, key-only generated config, tier resolution, auth activation, and budget enforcement admitting this priced credential.

Intent

Tier note: MID and LOW intentionally share Flash instead of naming an unverified third model. MID's precision/tool-heavy execution and LOW's high-throughput recon/triage roles both fit the cheap Flash tier; the full-size cyber build is reserved for HIGH. Consequently only cyber → flash is registered as an in-gateway fallback, since a second flash → flash edge would self-loop.

Blast radius

  • Tier-auto — tests, internal refactors, non-policy docs, lockfile-only dep bumps.
  • Tier-delegate — agent prompts, skill bodies, middleware internals, web/CLI features.
  • Tier-supply-chain — CI/workflows, package manifests and lockfiles, install script, compose / Dockerfiles, plugin contracts, .semgrep/**. Reaches every OSS user on the next release: request a review and wait for it.

Diff budget

Per QUALITY_BAR §Hard limits: ≤ 400 runtime-code lines, ≤ 10 files, 1 logical concern. docs/**, tests/**, .github/**, .semgrep/** are excluded.

  • My diff fits the budget.
  • Or I am requesting large-diff-approved from @PurpleCHOIms because: after excluding tests and docs, 11 tracked files change rather than 10, because the model-catalog generator must also rewrite config/litellm.yaml and the two generated CLI catalogs. The added runtime/data surface is about 130 lines, all one provider concern; there are no unrelated edits.

End-to-end verification

Run on Linux (Ubuntu on WSL2) at this branch's head, after uv sync:

  • Focused tests for the new paths: uv run pytest packages/decepticon/tests/unit/llm/test_litellm_dynamic_config.py packages/decepticon/tests/unit/llm/test_models.py packages/decepticon/tests/unit/cli/test_auth.py packages/decepticon/tests/unit/middleware/test_budget.py: 431 passed.
  • uv run model-catalog/test_catalog.py: 10 passed. uv run model-catalog/generate.py --check: oss: 207 public models, 4 outputs; clean, so config/litellm.yaml and the CLI catalogs match the catalog and overlay sources.
  • make ci-lint: ruff check and ruff format clean (940 files), basedpyright 0 errors.
  • The ids, context, max output and prices were read from the public GET https://api.abliteratedllm.dev/v1/models on 2026-11-19.

Not run: make ci-test, make smoke and a live stack. In that environment the wider packages/decepticon/tests/unit run stops at collection in mcp_server/ tests (No module named 'mcp'), the same on main. No inference call went through a running Decepticon.

Testing

  • make quality passes (Python + CLI + Web)
  • make smoke succeeds (clean local build + OSS-style up + health checks)
  • pytest tests/ passes (run this if you touched docker-compose.yml or tests/)
  • Every new/changed test was watched to fail without the change and pass with it
  • Every new/changed code path was executed on my machine, not just unit-tested in isolation
  • Manual testing (describe): the focused tests, catalog test, generator drift check and make ci-lint above, plus the public model-catalog read

Quality Bar self-check

  • No banned pattern from QUALITY_BAR §Banned patterns appears in the diff (no except Exception: pass, no bare except, no bare # type: ignore / # noqa, no _ = call(), no print( in production code, no mutable defaults, no wildcard imports, no TODO without issue link, no raise NotImplementedError in a delivered feature, no pytest.mark.skip / xfail without linked issue, no mocked-system-under-test, no # pragma: no cover for coverage chasing).
  • No AI-slop signature from QUALITY_BAR §AI-slop signatures survives (no defensive if x is not None: the types already prove, no helper-used-once, no speculative **kwargs, no data/result/item placeholder names, no docstrings restating the signature, no em-dash salad, no "leverages X to robustly handle Y").
  • Every changed line traces to the stated intent. No drive-by formatting, renaming, or reordering.
  • Every public function I added/changed has explicit type annotations including return type, and every raised exception is a named class.
  • I would merge this PR if a stranger opened it.
  • If I were tired and reviewing this at the end of a long day, I would still merge it.

AI-assisted contribution attestation

By opening this PR, you confirm — whether or not AI assistance was used — that you followed CONTRIBUTING_AGENT.md and meet the QUALITY_BAR.md. The diff adds one provider only; no guard rails are weakened, and the checks that were not run are stated above rather than ticked.

Related Issues

Relates to #453, #956 and #985. No issue is closed by this PR.

Register abliteratedllm_api with HIGH glm-5.3-cyber-abliterated and MID/LOW glm-5.3-flash-abliterated at https://api.abliteratedllm.dev/v1 behind ABLITERATEDLLM_API_KEY.
Mirror the static LiteLLM and generated CLI catalogs with published per-token input/output/cache-read prices so budget caps remain measurable, plus routing, pricing, auth and budget tests.
@github-actions

Copy link
Copy Markdown

Thank you for your interest in contributing to Decepticon, @whiteworthy.

This project uses a vouch system for first-time contributors. Before submitting a pull request, you need to be vouched by a maintainer.

To get vouched:

  1. Open a Vouch Request discussion.
  2. Describe what you want to change and why.
  3. Write in your own words — do not have an AI generate the request.
  4. A maintainer will comment /vouch if approved.
  5. Once vouched, open a new PR (preferred) or reopen this one after a few minutes.

See CONTRIBUTING.md for details.

@github-actions github-actions Bot closed this Nov 19, 2026
@whiteworthy whiteworthy changed the title sure: I operate AbliteratedLLM. feat(llm): add AbliteratedLLM OpenAI-compatible gateway Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant