Skip to content

Add Consensus Protocol as an inference provider - #2359

Open
jonpry wants to merge 1 commit into
huggingface:mainfrom
jonpry:add-consensus-protocol-provider
Open

jonpry wants to merge 1 commit into
huggingface:mainfrom
jonpry:add-consensus-protocol-provider

Conversation

@jonpry

@jonpry jonpry commented Aug 9, 2026 •

Copy link
Copy Markdown

Adds Consensus Protocol as an inference provider, per step 2 of register-as-a-provider.

Consensus Protocol serves open-weight models (Qwen3, GPT-OSS) over an OpenAI-compatible API at https://api.consensusprotocol.org.

Implementation

A plain BaseConversationalTask with no overrides — the endpoint is OpenAI-compatible on /v1/chat/completions and accepts the key via Authorization: Bearer, so the default helper works as-is.

File
providers/consensus-protocol.ts The task helper
types.ts INFERENCE_PROVIDERS + PROVIDERS_HUB_ORGS
lib/getProviderHelper.ts Import + PROVIDERS entry
providers/consts.ts HARDCODED_MODEL_INFERENCE_MAPPING entry
README.md Both provider lists
test/InferenceClient.spec.ts Conversational + streaming tests

Provider slug is consensus-protocol and the Hub org is consensus-protocol — kept aligned per the "InferenceProvider should == org namespace" convention in types.ts.

Testing

  • pnpm check (tsc), pnpm lint:check (eslint), pnpm format:check (oxfmt) — all clean
  • Both new tests executed live against the real endpoint (temporarily un-skipping the suite) using Qwen/Qwen3-Coder-30B-A3B-Instruct → qwen3-coder-30b — green

Note

Low Risk
Additive provider registration with no changes to existing routing or auth; risk is limited to new optional provider: "consensus-protocol" usage.

Overview
Registers Consensus Protocol (consensus-protocol) as a third-party inference provider so InferenceClient can route conversational chat (including streaming) to https://api.consensusprotocol.org via the standard OpenAI-compatible BaseConversationalTask helper.

Wiring follows the usual provider pattern: slug and Hub org in types.ts, PROVIDERS in getProviderHelper.ts, an empty dev mapping slot in consts.ts, README provider/model list links, and integration tests for chatCompletion / chatCompletionStream using HF_CONSENSUS_PROTOCOL_KEY.

Reviewed by Cursor Bugbot for commit 00205ff. Bugbot is set up for automated code reviews on this repo. Configure here.

@jonpry
jonpry force-pushed the add-consensus-protocol-provider branch from 6a00fc8 to 00205ff Compare August 9, 2026 17:19
Adds Consensus Protocol (https://api.consensusprotocol.org) as a
third-party inference provider, following the existing provider
registration pattern.

- providers/consensus-protocol.ts: BaseConversationalTask helper
- types.ts: INFERENCE_PROVIDERS + PROVIDERS_HUB_ORGS (consensus-protocol)
- lib/getProviderHelper.ts: import + PROVIDERS entry
- providers/consts.ts: HARDCODED_MODEL_INFERENCE_MAPPING entry
- README.md: both provider lists
- test/InferenceClient.spec.ts: conversational + streaming tests
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