Skip to content

feat(provider): add TokenLab - #1903

Merged
zerob13 merged 2 commits into
ThinkInAIXYZ:devfrom
hedging8563:codex/add-tokenlab-provider
Jul 9, 2026
Merged

feat(provider): add TokenLab#1903
zerob13 merged 2 commits into
ThinkInAIXYZ:devfrom
hedging8563:codex/add-tokenlab-provider

Conversation

@hedging8563

@hedging8563 hedging8563 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add TokenLab to the default provider list
  • configure TokenLab as an OpenAI-compatible provider at https://api.tokenlab.sh/v1
  • use a small generate-text key check with gpt-5.4-mini
  • add the TokenLab provider icon and ModelIcon coverage

Notes

TokenLab also exposes native Responses, Anthropic Messages, and Gemini-compatible endpoints. This PR keeps the default DeepChat integration on the existing OpenAI-compatible path so users can fetch the live model list from /v1/models without extra provider-specific code.

Testing

  • corepack pnpm run format
  • corepack pnpm run i18n
  • corepack pnpm run lint
  • corepack pnpm exec vitest --config vitest.config.renderer.ts test/renderer/components/ModelIcon.test.ts
  • git diff --check

Summary by CodeRabbit

  • New Features
    • Added support for a new AI provider option, TokenLab.
    • TokenLab is now available in provider selection and can be resolved like existing providers (including default check settings).
    • Added TokenLab’s official endpoint and related website links for easier setup and reference.
    • Added a TokenLab model icon to the UI model/icon mapping.
  • Tests
    • Updated ModelIcon tests to cover the TokenLab icon rendering.

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds TokenLab as a supported provider, wires its provider definition into resolution, and adds renderer icon mapping plus test coverage for the new tokenlab model ID.

Changes

TokenLab provider and icon support

Layer / File(s) Summary
Register TokenLab provider
src/main/presenter/configPresenter/providers.ts, src/main/presenter/llmProviderPresenter/providerRegistry.ts
Adds TokenLab to DEFAULT_PROVIDERS and registers tokenlab in PROVIDER_ID_REGISTRY with OPENAI_BASE, generate-text checking, API-key credentials, and fixed check parameters.
Map TokenLab icon and test it
src/renderer/src/components/icons/modelIconRegistry.ts, test/renderer/components/ModelIcon.test.ts
Adds the TokenLab icon asset to modelIcons and extends the ModelIcon test to render tokenlab and assert the expected icon URL.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related issues

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding TokenLab as a provider.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@zerob13
zerob13 merged commit c1d7550 into ThinkInAIXYZ:dev Jul 9, 2026
3 checks passed
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.

2 participants