Skip to content

feat: add Abliteration.ai provider#10403

Open
abliteration-ai wants to merge 4 commits into
cline:mainfrom
abliteration-ai:feat/abliteration-provider
Open

feat: add Abliteration.ai provider#10403
abliteration-ai wants to merge 4 commits into
cline:mainfrom
abliteration-ai:feat/abliteration-provider

Conversation

@abliteration-ai

Copy link
Copy Markdown

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:

  • Adds an AbliterationHandler using https://api.abliteration.ai/v1
  • Adds the documented abliterated-model with 150K context, streaming, tool calling, and vision metadata
  • Adds settings UI, API key validation, configured-provider detection, secret storage, provider defaults, and proto conversions
  • Adds unit coverage for default model selection, OpenAI-compatible streaming, tool call deltas, and token cost reporting

Docs referenced:

Test Procedure

  • npm run format
  • npm run lint
  • npm run check-types
  • npm run test:unit -- --grep AbliterationHandler
  • npm test
    • Unit tests: 1426 passing, 4 pending
    • Integration tests: 558 passing

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • ♻️ Refactor Changes
  • 💅 Cosmetic Changes
  • 📚 Documentation update
  • 🏃 Workflow Changes

Pre-flight Checklist

  • Changes are limited to a single feature, bugfix or chore (split larger changes into separate PRs)
  • Tests are passing (npm test) and code is formatted and linted (npm run format && npm run lint)
  • I have reviewed contributor guidelines

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.

@changeset-bot

changeset-bot Bot commented Apr 25, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 5e4f00f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@cline-for-jetbrains-workflow

Copy link
Copy Markdown

JetBrains Plugin tests failed

⚠️ Action Required: This PR needs to be updated to ensure compatibility with both cline-core and JetBrains.

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:

  • The cline-core functionality
  • JetBrains IDE integration

Please check the workflow logs for specific test failure details and update your PR accordingly.

Branch: feat/abliteration-provider
Workflow: View run

@greptile-apps

greptile-apps Bot commented Apr 25, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This 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 ↔ ApiConfiguration conversion. The implementation faithfully follows the patterns established by peer providers (AskSage, AIhubmix, etc.) and includes unit tests covering default model selection, streaming, tool-call deltas, and usage cost reporting.

Confidence Score: 4/5

Safe 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

Important Files Changed

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]
Loading
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

Comment thread src/shared/api.ts Outdated
@abliteration-ai abliteration-ai force-pushed the feat/abliteration-provider branch from 4e6389c to 0309c9b Compare April 25, 2026 07:30
Bojun-Vvibe added a commit to Bojun-Vvibe/oss-contributions that referenced this pull request Apr 25, 2026
- 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.
Bojun-Vvibe added a commit to Bojun-Vvibe/oss-contributions that referenced this pull request Apr 25, 2026
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.
Bojun-Vvibe added a commit to Bojun-Vvibe/oss-digest that referenced this pull request Apr 25, 2026
…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.
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