Skip to content

Feat/tencent tokenhub provider#16860

Closed
Contentment003111 wants to merge 7 commits into
NousResearch:mainfrom
Contentment003111:feat/tencent-tokenhub-provider
Closed

Feat/tencent tokenhub provider#16860
Contentment003111 wants to merge 7 commits into
NousResearch:mainfrom
Contentment003111:feat/tencent-tokenhub-provider

Conversation

@Contentment003111

Copy link
Copy Markdown

Register tencent-tokenhub as a new API-key provider targeting https://tokenhub.tencentmaas.com/v1. Includes full provider wiring (auth, models, doctor, CLI, overlay, aliases), 65 new test cases, and documentation updates.

Files changed: 13 modified, 1 new (+637/-6 lines)

What does this PR do?

Add tencent-tokenhub as a new API-key provider, enabling users to access Tencent's TokenHub MaaS platform (https://tokenhub.tencentmaas.com/v1) through Hermes.

TokenHub is Tencent's model-as-a-service gateway that provides access to models like tencent/hy3-preview. This PR follows the same registration pattern as existing providers (Xiaomi, ArceeAI, etc.) and includes full provider wiring, comprehensive tests, and documentation.

Related Issue

N/A — new provider integration.

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

Core Implementation

  • hermes_cli/providers.py — Register tencent-tokenhub in HermesOverlay and _ALIASES
  • hermes_cli/auth.py — Add ProviderConfig entry in PROVIDER_REGISTRY + aliases (tencent, tokenhub, tencent-cloud, tencentmaas) in resolve_provider()
  • hermes_cli/models.py — Add default model definitions for tencent-tokenhub
  • hermes_cli/doctor.py — Include tencent-tokenhub in diagnostic checks
  • hermes_cli/main.py — Wire up tencent-tokenhub in CLI entry point
  • agent/model_metadata.py — Add model metadata entries
  • agent/auxiliary_client.py — Register auxiliary client support

Tests (65 new test cases)

  • tests/hermes_cli/test_tencent_tokenhub_provider.pyNew file (494 lines), 60 tests covering: provider config, auth resolution, alias mapping, model definitions, doctor integration, overlay wiring, model catalog, and env-var isolation
  • tests/hermes_cli/test_runtime_provider_resolution.py — +5 runtime resolution tests for tencent-tokenhub
  • tests/hermes_cli/test_xiaomi_provider.py — Add TOKENHUB_API_KEY to env cleanup for hermetic isolation
  • tests/hermes_cli/test_arcee_provider.py — Add TOKENHUB_API_KEY to env cleanup for hermetic isolation

Documentation

  • website/docs/integrations/providers.md — Add tencent-tokenhub provider documentation
  • website/docs/reference/environment-variables.md — Document TOKENHUB_API_KEY
  • website/static/api/model-catalog.json — Add tencent/hy3-preview to model catalog

How to Test

  1. Run tencent-tokenhub specific tests: pytest tests/hermes_cli/test_tencent_tokenhub_provider.py -v
  2. Run runtime resolution tests: pytest tests/hermes_cli/test_runtime_provider_resolution.py -k "TencentTokenhub" -v
  3. Run all related provider tests to verify no regressions: pytest tests/hermes_cli/test_xiaomi_provider.py tests/hermes_cli/test_arcee_provider.py -v
  4. Verify end-to-end (requires TOKENHUB_API_KEY): export TOKENHUB_API_KEY="your-key-here" && hermes -p tencent-tokenhub -q "Hello"

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (65 new test cases, 605 total related tests pass)
  • I've tested on my platform: Linux (CentOS)

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings)
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard comp/agent Core agent loop, run_agent.py, prompt builder labels Apr 28, 2026
simonweng added 7 commits April 28, 2026 15:00
Register tencent-tokenhub as a new API-key provider targeting
https://tokenhub.tencentmaas.com/v1. Includes full provider wiring
(auth, models, doctor, CLI, overlay, aliases), 65 new test cases,
and documentation updates.

Files changed: 13 modified, 1 new (+143/-6 lines)
OpenRouter lists the model as tencent/hy3-preview:free (with :free suffix).
Update OPENROUTER_MODELS, model-catalog.json, and tests to match.
@Contentment003111 Contentment003111 force-pushed the feat/tencent-tokenhub-provider branch from c212efe to a9a5daa Compare April 28, 2026 07:01
teknium1 pushed a commit that referenced this pull request Apr 28, 2026
Registers tencent-tokenhub (https://tokenhub.tencentmaas.com/v1) as a
new API-key provider with model tencent/hy3-preview (256K context).

- PROVIDER_REGISTRY entry + TOKENHUB_API_KEY / TOKENHUB_BASE_URL env vars
- Aliases: tencent, tokenhub, tencent-cloud, tencentmaas
- openai_chat transport with is_tokenhub branch for top-level
  reasoning_effort (Hy3 is a reasoning model)
- tencent/hy3-preview:free added to OpenRouter curated list
- 60+ tests (provider registry, aliases, runtime resolution,
  credentials, model catalog, URL mapping, context length)
- Docs: integrations/providers.md, environment-variables.md,
  model-catalog.json

Author: simonweng <simonweng@tencent.com>
Salvaged from PR #16860 onto current main (resolved conflicts with
#16935 Azure Anthropic env-var hint tests and the --provider choices=
list removal in chat_parser).
teknium1 pushed a commit that referenced this pull request Apr 28, 2026
AUTHOR_MAP entry for the tencent-tokenhub provider PR #16860 contributor.
@teknium1

Copy link
Copy Markdown
Contributor

Merged via #16960 — your commit was cherry-picked onto current main with your authorship preserved (see commit a6a6cf0). Thanks for the thorough provider integration and the 60+ tests!

Salvage notes: resolved a conflict with #16935 in the runtime-resolver tests (kept both test classes), and dropped a stray blank line in agent/model_metadata.py. The --provider choices= list in chat_parser was recently removed on main (user-defined providers from providers: in config.yaml are now valid), so that part of your diff was dropped in favor of main's newer approach.

ulasbilgen pushed a commit to ulasbilgen/hermes-adhd-agent that referenced this pull request May 1, 2026
Registers tencent-tokenhub (https://tokenhub.tencentmaas.com/v1) as a
new API-key provider with model tencent/hy3-preview (256K context).

- PROVIDER_REGISTRY entry + TOKENHUB_API_KEY / TOKENHUB_BASE_URL env vars
- Aliases: tencent, tokenhub, tencent-cloud, tencentmaas
- openai_chat transport with is_tokenhub branch for top-level
  reasoning_effort (Hy3 is a reasoning model)
- tencent/hy3-preview:free added to OpenRouter curated list
- 60+ tests (provider registry, aliases, runtime resolution,
  credentials, model catalog, URL mapping, context length)
- Docs: integrations/providers.md, environment-variables.md,
  model-catalog.json

Author: simonweng <simonweng@tencent.com>
Salvaged from PR NousResearch#16860 onto current main (resolved conflicts with
NousResearch#16935 Azure Anthropic env-var hint tests and the --provider choices=
list removal in chat_parser).
ulasbilgen pushed a commit to ulasbilgen/hermes-adhd-agent that referenced this pull request May 1, 2026
AUTHOR_MAP entry for the tencent-tokenhub provider PR NousResearch#16860 contributor.
donald131 pushed a commit to donald131/hermes-agent that referenced this pull request May 2, 2026
Registers tencent-tokenhub (https://tokenhub.tencentmaas.com/v1) as a
new API-key provider with model tencent/hy3-preview (256K context).

- PROVIDER_REGISTRY entry + TOKENHUB_API_KEY / TOKENHUB_BASE_URL env vars
- Aliases: tencent, tokenhub, tencent-cloud, tencentmaas
- openai_chat transport with is_tokenhub branch for top-level
  reasoning_effort (Hy3 is a reasoning model)
- tencent/hy3-preview:free added to OpenRouter curated list
- 60+ tests (provider registry, aliases, runtime resolution,
  credentials, model catalog, URL mapping, context length)
- Docs: integrations/providers.md, environment-variables.md,
  model-catalog.json

Author: simonweng <simonweng@tencent.com>
Salvaged from PR NousResearch#16860 onto current main (resolved conflicts with
NousResearch#16935 Azure Anthropic env-var hint tests and the --provider choices=
list removal in chat_parser).
donald131 pushed a commit to donald131/hermes-agent that referenced this pull request May 2, 2026
AUTHOR_MAP entry for the tencent-tokenhub provider PR NousResearch#16860 contributor.
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
Registers tencent-tokenhub (https://tokenhub.tencentmaas.com/v1) as a
new API-key provider with model tencent/hy3-preview (256K context).

- PROVIDER_REGISTRY entry + TOKENHUB_API_KEY / TOKENHUB_BASE_URL env vars
- Aliases: tencent, tokenhub, tencent-cloud, tencentmaas
- openai_chat transport with is_tokenhub branch for top-level
  reasoning_effort (Hy3 is a reasoning model)
- tencent/hy3-preview:free added to OpenRouter curated list
- 60+ tests (provider registry, aliases, runtime resolution,
  credentials, model catalog, URL mapping, context length)
- Docs: integrations/providers.md, environment-variables.md,
  model-catalog.json

Author: simonweng <simonweng@tencent.com>
Salvaged from PR NousResearch#16860 onto current main (resolved conflicts with
NousResearch#16935 Azure Anthropic env-var hint tests and the --provider choices=
list removal in chat_parser).
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
AUTHOR_MAP entry for the tencent-tokenhub provider PR NousResearch#16860 contributor.
dannyJ848 pushed a commit to dannyJ848/hermes-agent that referenced this pull request May 17, 2026
Registers tencent-tokenhub (https://tokenhub.tencentmaas.com/v1) as a
new API-key provider with model tencent/hy3-preview (256K context).

- PROVIDER_REGISTRY entry + TOKENHUB_API_KEY / TOKENHUB_BASE_URL env vars
- Aliases: tencent, tokenhub, tencent-cloud, tencentmaas
- openai_chat transport with is_tokenhub branch for top-level
  reasoning_effort (Hy3 is a reasoning model)
- tencent/hy3-preview:free added to OpenRouter curated list
- 60+ tests (provider registry, aliases, runtime resolution,
  credentials, model catalog, URL mapping, context length)
- Docs: integrations/providers.md, environment-variables.md,
  model-catalog.json

Author: simonweng <simonweng@tencent.com>
Salvaged from PR NousResearch#16860 onto current main (resolved conflicts with
NousResearch#16935 Azure Anthropic env-var hint tests and the --provider choices=
list removal in chat_parser).
dannyJ848 pushed a commit to dannyJ848/hermes-agent that referenced this pull request May 17, 2026
AUTHOR_MAP entry for the tencent-tokenhub provider PR NousResearch#16860 contributor.
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
Registers tencent-tokenhub (https://tokenhub.tencentmaas.com/v1) as a
new API-key provider with model tencent/hy3-preview (256K context).

- PROVIDER_REGISTRY entry + TOKENHUB_API_KEY / TOKENHUB_BASE_URL env vars
- Aliases: tencent, tokenhub, tencent-cloud, tencentmaas
- openai_chat transport with is_tokenhub branch for top-level
  reasoning_effort (Hy3 is a reasoning model)
- tencent/hy3-preview:free added to OpenRouter curated list
- 60+ tests (provider registry, aliases, runtime resolution,
  credentials, model catalog, URL mapping, context length)
- Docs: integrations/providers.md, environment-variables.md,
  model-catalog.json

Author: simonweng <simonweng@tencent.com>
Salvaged from PR NousResearch#16860 onto current main (resolved conflicts with
NousResearch#16935 Azure Anthropic env-var hint tests and the --provider choices=
list removal in chat_parser).
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
AUTHOR_MAP entry for the tencent-tokenhub provider PR NousResearch#16860 contributor.
Egavasyug pushed a commit to Egavasyug/hermes-agent that referenced this pull request Jun 10, 2026
Registers tencent-tokenhub (https://tokenhub.tencentmaas.com/v1) as a
new API-key provider with model tencent/hy3-preview (256K context).

- PROVIDER_REGISTRY entry + TOKENHUB_API_KEY / TOKENHUB_BASE_URL env vars
- Aliases: tencent, tokenhub, tencent-cloud, tencentmaas
- openai_chat transport with is_tokenhub branch for top-level
  reasoning_effort (Hy3 is a reasoning model)
- tencent/hy3-preview:free added to OpenRouter curated list
- 60+ tests (provider registry, aliases, runtime resolution,
  credentials, model catalog, URL mapping, context length)
- Docs: integrations/providers.md, environment-variables.md,
  model-catalog.json

Author: simonweng <simonweng@tencent.com>
Salvaged from PR NousResearch#16860 onto current main (resolved conflicts with
NousResearch#16935 Azure Anthropic env-var hint tests and the --provider choices=
list removal in chat_parser).
Egavasyug pushed a commit to Egavasyug/hermes-agent that referenced this pull request Jun 10, 2026
AUTHOR_MAP entry for the tencent-tokenhub provider PR NousResearch#16860 contributor.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent loop, run_agent.py, prompt builder comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants