> For the complete documentation index, see [llms.txt](https://ai-os-and-trend-finder.gitbook.io/ai-os-and-trend-finder-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ai-os-and-trend-finder.gitbook.io/ai-os-and-trend-finder-docs/.spec_system/archive/phases/phase_40/session_02_models_and_provider_readiness.md).

# Session 02: Models And Provider Readiness

**Session ID**: `phase40-session02-models-and-provider-readiness` **Status**: Not Started **Estimated Tasks**: \~12-25 **Estimated Duration**: 2-4 hours

***

## Objective

Make the public Hermes model contract tolerate upstream 2.10.1 shape while preserving existing AI OS consumers and safe provider filtering.

***

## Scope

### In Scope (MVP)

* Extend `HermesModelsBody` and parser tests for AI OS `ok: true` bodies and upstream-style no-`ok` bodies.
* Preserve `configuredDefault` while supporting `default`, `catalog`, `mixtures`, `configured`, and optional `context` fields.
* Read MoA presets from `~/.hermes/config.yaml` with `js-yaml` and fail softly for missing or malformed config.
* Extend provider aliases, labels, auth-kind mapping, and env-key readiness for upstream and retained AI OS provider IDs.
* Build configured providers from default provider, auth JSON, Hermes env files, config providers, and existing readiness classification.
* Keep discovered MoA presets selectable even when catalog providers are filtered.

### Out of Scope

* Chat payload override wiring.
* UI model selector components.
* Full model catalog refresh beyond fields needed to prove the contract.

***

## Prerequisites

* [ ] Session 01 decisions and invariants are recorded.

***

## Deliverables

1. Expanded public model response types and tolerant parser behavior.
2. Updated provider readiness helpers and labels.
3. Tests for configured detection, aliases, MoA discovery, malformed config, and no secret or private path leakage.

***

## Success Criteria

* [ ] Old AI OS bodies, new AI OS bodies, upstream-style bodies, and demo fixtures parse.
* [ ] Google/Gemini aliases do not hide valid configured Google models.
* [ ] MoA presets are discoverable without exposing raw config content.
* [ ] Provider filtering shows all providers only when no configured providers are detected.

***

## Folded Source Session Split

The section below preserves the original Phase 40 session split detail for this session, including dependencies, decisions, outputs, and acceptance checks.

### Session 02: Models And Provider Readiness

**Objective**: Make the public Hermes model contract tolerate upstream 2.10.1 shape while preserving existing AI OS consumers and safe provider filtering.

**Scope**:

* Extend `HermesModelsBody` and parser tests for AI OS `ok: true` responses, upstream no-`ok` responses, `configuredDefault`, `default`, `catalog`, `mixtures`, `configured`, and optional `context` fields.
* Update `readHermesModels` to return expanded model data without breaking demo fixtures, status bars, Pantheon consumers, or existing hook behavior.
* Read MoA presets from `~/.hermes/config.yaml` with `js-yaml`, failing softly for missing or malformed config.
* Extend provider readiness aliases, labels, auth-kind mapping, and env-key detection for `googlegemini`, Google/Gemini aliases, `xai`, `xai-oauth`, `openai-codex`, `deepseek`, `sakana`, and retained AI OS aliases.
* Verify existing `MINIMAX_API_KEY` and `NVIDIA_API_KEY` coverage instead of treating them as missing work.
* Build configured providers from default provider, auth JSON, Hermes env files, config providers, and existing readiness classification.
* Keep discovered MoA presets selectable even when catalog providers are filtered by configured providers.

**Outputs**:

* Expanded public model response types and tolerant parser behavior.
* Updated provider readiness helpers and labels.
* Tests for configured detection, alias matching, MoA preset discovery, malformed config, and no secret/private path leakage.

**Dependencies / Notes**:

* Depends on Session 01.
* Assumption: `js-yaml` remains the parser for Hermes config reads.
* Decision: demo mode uses bundled safe catalog rows and optional bundled demo MoA rows only. It must not include live configured-provider summaries because demo mode does not read local Hermes state.

**Acceptance Checks**:

* Old AI OS bodies, new AI OS bodies, upstream 2.10.1-style bodies, and demo fixtures all parse.
* Google/Gemini aliases do not hide valid configured Google models.
* MoA presets are discoverable without exposing raw config content.
* The provider filter shows all providers only when no configured providers are detected.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ai-os-and-trend-finder.gitbook.io/ai-os-and-trend-finder-docs/.spec_system/archive/phases/phase_40/session_02_models_and_provider_readiness.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
