Repository navigation
feat(llm): add AbliteratedLLM OpenAI-compatible gateway - #1208
Closed
whiteworthy wants to merge 2 commits into
Closed
whiteworthy wants to merge 2 commits into
whiteworthy wants to merge 2 commits into
Conversation
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.
|
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:
See CONTRIBUTING.md for details. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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. SettingABLITERATEDLLM_API_KEYmakes Decepticon resolve HIGH toabliteratedllm/glm-5.3-cyber-abliteratedand MID/LOW toabliteratedllm/glm-5.3-flash-abliterated, registered in bothbuild_model_entry()and the generated staticconfig/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.
abliteratedllm/glm-5.3-cyber-abliteratedabliteratedllm/glm-5.3-flash-abliteratedBoth ids, 1,048,576-token context and 131,072 max output tokens were read from the public
GET https://api.abliteratedllm.dev/v1/modelson 2026-11-19; that endpoint needs no key. Rates are stored as per-token costs includingcache_read_input_token_cost, not $0 placeholders, so these routes are deliberately not added tomiddleware/budget.py::_SPEND_UNTRACKED_METHODS: a configuredDECEPTICON_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>+ pinnedhttps://api.abliteratedllm.dev/v1), theos.environ/ABLITERATEDLLM_API_KEYprovider credential, and one in-gateway HIGH → Flash fallback.config/litellm.yaml,clients/cli/src/commands/currentProdModels.tsandconfiguredModelRoutes.tsare 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 throughALLOWED_DYNAMIC_PROVIDERSand reuses the existingopenai/rewrite branch.decepticon_core/types/llm.py:AuthMethod.ABLITERATEDLLM_API,METHOD_MODELSHIGH/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 thedecepticon-cli authlabel. No key-prefix hint is pinned, so only the shared non-placeholder/minimum-length checks apply./modelgroup,.env.example,docs/setup-guide.mdrow and tier/budget note, and aCHAGELOG.mdUnreleased entry linking this PR.Intent
compat/gateway, OAuth methods and onboard wizard are untouched.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 → flashis registered as an in-gateway fallback, since a secondflash → flashedge would self-loop.Blast radius
.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.large-diff-approvedfrom@PurpleCHOImsbecause: after excluding tests and docs, 11 tracked files change rather than 10, because the model-catalog generator must also rewriteconfig/litellm.yamland 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: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, soconfig/litellm.yamland the CLI catalogs match the catalog and overlay sources.make ci-lint: ruff check and ruff format clean (940 files), basedpyright 0 errors.GET https://api.abliteratedllm.dev/v1/modelson 2026-11-19.Not run:
make ci-test,make smokeand a live stack. In that environment the widerpackages/decepticon/tests/unitrun stops at collection inmcp_server/tests (No module named 'mcp'), the same onmain. No inference call went through a running Decepticon.Testing
make qualitypasses (Python + CLI + Web)make smokesucceeds (clean local build + OSS-style up + health checks)pytest tests/passes (run this if you toucheddocker-compose.ymlortests/)make ci-lintabove, plus the public model-catalog readQuality Bar self-check
except Exception: pass, no bareexcept, no bare# type: ignore/# noqa, no_ = call(), noprint(in production code, no mutable defaults, no wildcard imports, noTODOwithout issue link, noraise NotImplementedErrorin a delivered feature, nopytest.mark.skip/xfailwithout linked issue, no mocked-system-under-test, no# pragma: no coverfor coverage chasing).if x is not None:the types already prove, no helper-used-once, no speculative**kwargs, nodata/result/itemplaceholder names, no docstrings restating the signature, no em-dash salad, no "leverages X to robustly handle Y").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.