feat: add Abliteration.ai provider#10403
Conversation
|
|
JetBrains Plugin tests failed ❌ The changes in this PR are causing test failures in the JetBrains plugin integration. Please review and fix your changes to ensure they work properly with:
Please check the workflow logs for specific test failure details and update your PR accordingly. Branch: |
Greptile SummaryThis PR adds Abliteration.ai as a new OpenAI-compatible provider, wiring it through the full provider stack: proto definitions, API handler, settings UI, secret storage, validation, configured-provider detection, and proto ↔ Confidence Score: 4/5Safe to merge; only a minor description/pricing-model inconsistency was found. All P2 findings — no logic errors, security issues, or missing integration points. The one comment is about a potentially misleading model description string, not a functional defect. src/shared/api.ts — model description vs. pricing field semantics
|
| Filename | Overview |
|---|---|
| src/core/api/providers/abliteration.ts | New AbliterationHandler following the standard OpenAI-compatible pattern; lazy client init, retry decorator, and streaming are all consistent with peer providers. |
| src/shared/api.ts | Adds abliterationModels and type exports; model description says 'combined token billing' while implementation uses separate inputPrice/outputPrice — minor but misleading. |
| src/core/api/providers/tests/abliteration.test.ts | Two tests cover default model selection and full streaming path including tool calls and usage; totalCost assertion (9) is arithmetically correct given $3/1M in+out. |
| webview-ui/src/components/settings/providers/AbliterationProvider.tsx | Settings component follows the established provider component pattern; ApiKeyField, ModelSelector, and ModelInfoView wired correctly. |
| proto/cline/models.proto | ABLITERATION enum value (42) and abliteration_api_key field (88) added without conflicting with existing field numbers. |
| proto/cline/state.proto | abliteration_api_key secret field (51) added correctly with a unique field number. |
| src/shared/proto-conversions/models/api-configuration-conversion.ts | Round-trip proto ↔ ApiConfiguration conversion for abliteration added in both directions; no gaps. |
| webview-ui/src/utils/validate.ts | Abliteration validation case requires API key, consistent with other key-only providers. |
| webview-ui/src/utils/getConfiguredProviders.ts | Abliteration added to configured-provider detection gated on API key presence, matching pattern of other key-only providers. |
| webview-ui/src/components/settings/utils/providerUtils.ts | getModelsForProvider, normalizeApiConfiguration, syncModeConfigurations, and getProviderInfo all updated consistently for abliteration. |
| src/shared/storage/state-keys.ts | abliterationApiKey added to SECRETS_KEYS list for secure storage. |
| src/shared/storage/provider-keys.ts | ProviderToApiKeyMap and ProviderDefaultModelMap updated correctly for abliteration. |
| src/shared/providers/providers.json | Abliteration entry added to provider list; placed between OpenAI Compatible and Anthropic. |
| src/core/api/index.ts | Handler factory correctly wires abliteration case with onRetryAttempt, abliterationApiKey, and mode-aware apiModelId. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User selects Abliteration.ai in Settings] --> B[AbliterationProvider component]
B --> C[ApiKeyField — abliterationApiKey]
B --> D[ModelSelector — abliterationModels]
C --> E[handleFieldChange → secret storage]
D --> F[handleModeFieldChange → planModeApiModelId / actModeApiModelId]
G[createHandlerForProvider] --> H[AbliterationHandler]
H --> I[ensureClient — createOpenAIClient\nhttps://api.abliteration.ai/v1]
I --> J[client.chat.completions.create\nstream: true, include_usage: true]
J --> K{chunk type}
K -->|delta.content| L[yield text]
K -->|delta.tool_calls| M[ToolCallProcessor → yield tool_calls]
K -->|chunk.usage| N[calculateApiCostOpenAI → yield usage]
Prompt To Fix All With AI
This is a comment left during a code review.
Path: src/shared/api.ts
Line: 1477-1480
Comment:
**Pricing model inconsistent with description**
The `description` says *"Usage is billed on combined input and output tokens"*, implying a single flat rate on total tokens, but the model is configured with separate `inputPrice` and `outputPrice` values. While both are `3.0` today (so the calculated cost is identical either way), the description will mislead users reading the ModelInfoView and could cause confusion if prices ever diverge. Either the description should reflect how the pricing is actually structured (separate input/output rates), or remove the combined-billing language.
```suggestion
inputPrice: 3.0,
outputPrice: 3.0,
temperature: 0,
description:
"Abliteration.ai's OpenAI-compatible model with streaming, tool calling, and vision support.",
```
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "feat: add Abliteration provider" | Re-trigger Greptile
4e6389c to
0309c9b
Compare
- charmbracelet/crush#2693 (merge-after-nits): stdio MCP server config 'args' weren't run through resolver.ResolveValue, so '$VESTIGE_DB' reached the subprocess as a literal. Fix threads each arg through the same resolver that already handles 'command'. Fallback-to-literal on resolve failure is a footgun for credential-bearing args — should fail loud. - anomalyco/opencode#24259 (merge-as-is): one-line ecosystem doc addition for opencode-simple-notify (Linux/Mac desktop notifications plugin). Standard supply-chain hygiene applies on the maintainer side. - OpenHands/OpenHands#14099 (merge-after-nits): branch-search router previously hard-rejected page!=1 with 400. Fix threads page through every provider's search_branches with the provider's native idiom (page-param for GitLab/Bitbucket, start-offset for BB-DC, slice for Forgejo/AzDO). GitHub uses cursor walk through 'after: $cursor' which is O(page) — needs a clamp to bound adversarial deep-page requests. - cline/cline#10403 (request-changes): adds Abliteration.ai as first-class provider. Handler/proto/UI plumbing follows the established pattern cleanly, but maxTokens: -1 sentinel in the model registry will produce wrong cost/budget calculations downstream (no other provider uses -1), and supportsTools() is hardcoded true rather than reading model.info. Both are 1-line fixes.
Lede counter through-drip-38 → through-drip-40. Eight new rows spliced into per-repo tables for openai/codex, BerriAI/litellm, continuedev/continue, ollama/ollama, charmbracelet/crush, anomalyco/opencode, All-Hands-AI/OpenHands, cline/cline. PRs: openai/codex#19526, BerriAI/litellm#26495, continuedev/continue#12206, ollama/ollama#15808, charmbracelet/crush#2693, anomalyco/opencode#24259, OpenHands/OpenHands#14099, cline/cline#10403.
…ly self-iteration cadence Anchored on cline/cline#10403 (abliteration-ai, head 3f1c9fd0): three states in 65 minutes (07:25:36Z open → 07:47:37Z → 08:30:15Z), median inter-state delta ~32m, zero maintainer interaction. Distinguishes vendor-self promotion cadence from canonical contributor PR cadence (driven by external review signal). Cross-references #59, #61, #67, #56.
Related Issue
Issue: #10402
Description
Adds Abliteration.ai as a first-class Cline provider.
This wires the documented OpenAI-compatible API into the existing provider system:
AbliterationHandlerusinghttps://api.abliteration.ai/v1abliterated-modelwith 150K context, streaming, tool calling, and vision metadataDocs referenced:
Test Procedure
npm run formatnpm run lintnpm run check-typesnpm run test:unit -- --grep AbliterationHandlernpm test1426 passing,4 pending558 passingType of Change
Pre-flight Checklist
npm test) and code is formatted and linted (npm run format && npm run lint)Screenshots
N/A. This adds a provider-specific settings form using the existing API key, model selector, and model info components.
Additional Notes
The feature request discussion is linked above. At submission time, the public discussion showed no maintainer comments yet.