Skip to content

feat(providers): add ai& (aiand) provider - #71690

Closed
jethac wants to merge 1 commit into
NousResearch:mainfrom
jethac:feat/aiand-provider
Closed

jethac wants to merge 1 commit into
NousResearch:mainfrom
jethac:feat/aiand-provider

Conversation

@jethac

@jethac jethac commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

What

Adds ai& (slug: aiand) as a bundled model-provider plugin. ai& serves a curated catalog of open frontier models through an OpenAI-compatible chat-completions endpoint at https://api.aiand.com/v1, so the generic chat_completions transport handles request/response/streaming/tool calls — the ProviderProfile is the core integration, following the same pattern as fireworks/gmi.

Why

ai& is live on models.dev (merged in anomalyco/models.dev#3327) under the aiand slug, so context windows, pricing, and capability metadata all resolve through Hermes' existing models.dev path — this PR only wires provider registration.

Configuration

# ~/.hermes/config.yaml
model:
  provider: aiand
  default: moonshotai/kimi-k2.7-code
# ~/.hermes/.env
AIAND_API_KEY=...

Aliases: ai&, ai-and. Endpoint overrides go through model.base_url in config.yaml (no AIAND_BASE_URL), per current policy (#61182 follow-up conventions).

Models (per models.dev catalog)

deepseek-ai/deepseek-v4-flash (default aux — $0.15/$0.25 per Mtok, 1M ctx), deepseek-ai/deepseek-v4-pro, moonshotai/kimi-k2.6, moonshotai/kimi-k2.7-code, zai-org/glm-5.1, zai-org/glm-5.2, qwen/qwen3.6-27b (free), openai/gpt-oss-120b, google/gemma-4-31b-it. The live /v1/models catalog is authoritative; the profile ships a curated agentic fallback_models list.

Wiring

  • plugins/model-providers/aiand/: ProviderProfile + plugin.yaml (auth/config/models/doctor/metadata registries auto-extend from it)
  • hermes_cli/providers.py: HERMES_OVERLAYS entry + aliases + label
  • hermes_cli/models.py: CANONICAL_PROVIDERS (curated picker order) + alias map
  • hermes_cli/config.py: OPTIONAL_ENV_VARS["AIAND_API_KEY"]
  • hermes_cli/doctor.py: env hint + vendor-slug allowance (ai&'s catalog is exclusively vendor-prefixed IDs)
  • agent/models_dev.py: PROVIDER_TO_MODELS_DEV mapping
  • .env.example, website/docs/integrations/providers.md, website/docs/reference/environment-variables.md

Test evidence

  • New: tests/plugins/model_providers/test_aiand_profile.py, tests/hermes_cli/test_aiand_provider.py (both resolvers, registry, overlay, config, doctor slash-form regression, credentials, runtime resolution, aux client), tests/run_agent/test_aiand_live.py (opt-in), discovery spot-check — 38 passed
  • Neighboring suites: test_api_key_providers.py, test_fireworks_provider.py, test_gmi_provider.py (225 passed); test_model_metadata.py, test_models_dev.py, test_auxiliary_client.py, test_runtime_provider_resolution.py, test_overlay_slug_resolution.py (680 passed, 2 pre-existing qwen-oauth failures also fail on clean main @ 10160a180); test_doctor*.py + test_models.py (175 passed)

Live verification

One real completion driven through the Hermes provider path (resolve_provider_client('aiand')):

endpoint: https://api.aiand.com/v1/
model: google/gemma-4-31B-it
content: 'pong'
tokens: prompt=24 completion=2 total=26

@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/cli CLI entry point, hermes_cli/, setup wizard comp/plugins Plugin system and bundled plugins labels Jul 26, 2026
@jethac

jethac commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

As usual, the only reason this isn't passing is because I need my AUTHOR_MAP entry revised. All other tests pass!

@jethac
jethac force-pushed the feat/aiand-provider branch 2 times, most recently from 312f056 to 84a6a45 Compare July 29, 2026 17:42
Adds ai& (slug: aiand) as a bundled model-provider plugin. ai& serves a
curated catalog of open frontier models (DeepSeek V4, Kimi K2.x, GLM 5.x,
Qwen, Gemma, gpt-oss) through an OpenAI-compatible chat-completions
endpoint at https://api.aiand.com/v1, so the generic chat_completions
transport handles request/response/streaming/tool calls — the profile is
the core integration. The provider is live on models.dev under the
'aiand' slug (anomalyco/models.dev#3327), so context windows, pricing,
and capability metadata resolve through the standard models.dev path.

Provider registration (same pattern as fireworks/gmi):
- plugins/model-providers/aiand/: ProviderProfile + plugin.yaml.
  AIAND_API_KEY only (endpoint overrides go through model.base_url in
  config.yaml, per current policy). default_aux_model
  deepseek-ai/deepseek-v4-flash (cheap, 1M context); curated agentic
  fallback_models mirroring the models.dev catalog. Aliases: ai&, ai-and.
- hermes_cli/providers.py: HERMES_OVERLAYS entry + aliases + label so
  resolve_provider_full('aiand') resolves.
- hermes_cli/models.py: CANONICAL_PROVIDERS entry (curated picker order)
  + alias map entries.
- hermes_cli/config.py: OPTIONAL_ENV_VARS entry for AIAND_API_KEY.
- hermes_cli/doctor.py: AIAND_API_KEY env hint; aiand accepts
  vendor/model slugs (its catalog is exclusively vendor-prefixed IDs),
  so doctor doesn't tell users to switch to openrouter.
- agent/models_dev.py: PROVIDER_TO_MODELS_DEV mapping (aiand -> aiand).
- .env.example + website docs (providers page, env vars reference).

Tests: profile contract, first-class wiring (both resolvers, registry,
overlay, config, doctor slash-form regression, credentials, runtime
resolution, aux client), discovery spot-check, and an opt-in live smoke
test driven through the Hermes runtime.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

[rebase note 2026-07-30: upstream 1fe0611 moved OPTIONAL_ENV_VARS out of
hermes_cli/config.py; the AIAND_API_KEY entry now lands in
hermes_cli/config_defaults.py. Semantics unchanged.]
@jethac
jethac force-pushed the feat/aiand-provider branch from 84a6a45 to 93af74d Compare July 30, 2026 01:54
@teknium1

Copy link
Copy Markdown
Collaborator

Thanks for the careful provider wiring, documentation, and focused test coverage. This automated hermes-sweeper review is closing the PR under the standing in-tree provider integration policy.

  • The PR adds a new bundled ai& provider at plugins/model-providers/aiand/__init__.py (PR commit 93af74d07772e28092653b2035d3cfa8470bd573).
  • AGENTS.md:126-136 and AGENTS.md:797-813 require third-party/vendor integrations to ship as standalone plugins rather than under this repository's plugins/ tree; this is a maintenance-boundary decision, not a quality judgment.
  • The existing provider loader already discovers user plugins from $HERMES_HOME/plugins/model-providers/<name>/ (providers/__init__.py:91-99, 163-171). Please publish ai& as a standalone model-provider plugin that users can install there or through a pip entry point, and promote it in #plugins-skills-and-skins.

Closed as not-planned per standing maintainer policy (in-tree-provider-integration). This is a design-direction decision, not a code-quality judgment — see the Contribution Rubric in AGENTS.md for what the project is looking for. If you believe this policy was misapplied to your change, comment here and a maintainer will take a look.

@teknium1 teknium1 closed this Jul 30, 2026
@teknium1 teknium1 added sweeper:not-planned Sweeper: closed per standing maintainer policy (design direction) sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users labels Jul 30, 2026
@jethac

jethac commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

Repackaged as a standalone plugin per the provider policy: https://github.com/jethac/hermes-aiand

git clone https://github.com/jethac/hermes-aiand \
  "${HERMES_HOME:-$HOME/.hermes}/plugins/model-providers/aiand"

No core edits or config changes — the loader discovers it, and the auto-extension hooks (auth resolver/registry, picker, optional env vars, credentials, aux client) cover nearly everything the in-tree version wired by hand. The repo README documents the few cosmetic gaps (static alias maps, doctor hints) for anyone hitting them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/cli CLI entry point, hermes_cli/, setup wizard comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users sweeper:not-planned Sweeper: closed per standing maintainer policy (design direction) sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants