Skip to content

feat: add Hoonify AI chat provider - #3499

Merged
Salazareo merged 1 commit into
mainfrom
hoonify-provider
Aug 26, 2026
Merged

feat: add Hoonify AI chat provider#3499
Salazareo merged 1 commit into
mainfrom
hoonify-provider

Conversation

@jelveh

@jelveh jelveh commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Adds Hoonify — an OpenAI-compatible gateway for open-weights models — as a chat provider for the puter-chat-completion interface.

What

  • HoonifyProvider: OpenAI SDK against https://api.hoonify.ai/v1 (overridable via providers.hoonify.apiBaseUrl), streaming with include_usage, tool calling, and Hoonify's top_k sampling extension via custom.top_k.
  • Static model catalog (GLM-5.2, Gemma 4 31B Instruct, Qwen3.6-27B) priced from Hoonify's published catalog. Static rather than fetched because GET /v1/models carries no prices — a dynamic catalog would meter usage at zero cost.
  • Registered as an aggregator so its aliases can never shadow first-party providers. Catalog ids are namespaced (hoonify:<vendor>/<model>); the lowercased ids map back to exact-case wire ids via a wireId field. Qwen/Qwen3.6-27B deliberately gets no vendor-scoped alias — it collides with an existing Alibaba alias, and a colliding alias drops the whole model from the routing map (a test pins this).
  • Enabled by providers.hoonify.apiKey; disabled otherwise. No puter.js/type changes needed — model discovery is dynamic.

Testing

  • 23 offline unit tests (mocked OpenAI SDK, real in-memory PuterServer + live MeteringService): request shape, alias/wire-id resolution, non-stream + streaming output, metering costs, tool calls, error passthrough.
  • Env-gated integration test (PUTER_TEST_AI_HOONIFY_API_KEY) — passes against the live API, as does a driver-level end-to-end completion. Live checks also confirmed the models endpoint matches the shipped catalog and that streaming emits a final usage chunk.
  • Driver suites pass (44/44 incl. updated registration/cost-line assertions); full backend run shows no new failures vs a stashed-HEAD baseline.

No auth/permission surface changes; the provider only activates when a key is configured.

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 93.69%
⬆️ +0.01%
24685 / 26347
🔵 Statements 91.94%
⬆️ +0.01%
26663 / 28998
🔵 Functions 89.91%
⬆️ +0.03%
4313 / 4797
🔵 Branches 80.55%
🟰 ±0%
18001 / 22345
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/backend/drivers/ai-chat/ChatCompletionDriver.ts 96.3%
⬆️ +0.04%
89.67%
⬆️ +0.06%
97.43%
🟰 ±0%
97.63%
⬆️ +0.02%
199-202, 325, 355, 369, 411-413, 442-446, 480, 495, 525, 585, 704, 728, 734, 741, 1399
src/backend/drivers/ai-chat/providers/hoonify/HoonifyProvider.ts 100% 87.09% 100% 100%
src/backend/drivers/ai-chat/providers/hoonify/models.ts 100% 100% 100% 100%
src/backend/drivers/ai-chat/utils/modelRouting.ts 100%
🟰 ±0%
90%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
Generated in workflow #847 for commit 7ac2db9 by the Vitest Coverage Report Action

@404oops 404oops left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like everything's in line.

@Salazareo
Salazareo merged commit 7472002 into main Aug 26, 2026
5 checks passed

@ProgrammerIn-wonderland ProgrammerIn-wonderland left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than the missing model, code looks fine

65_536,
usdPerMToken(0.32, 3.2, 0.15),
['qwen/qwen3.6-27b'],
),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing model thinkingmachines/Inkling-Small $0.50 in $1.20 out $0.10 cached input

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.

4 participants