Skip to content

feat: add provider-neutral model role contracts - #95

Open
sakibalig wants to merge 3 commits into
mainfrom
feat/provider-neutral-model-roles-foundation
Open

sakibalig wants to merge 3 commits into
mainfrom
feat/provider-neutral-model-roles-foundation

Conversation

@sakibalig

@sakibalig sakibalig commented Aug 24, 2026 •

Copy link
Copy Markdown

Summary

Establish the provider-neutral model identity and role-manifest foundation for Fathom.

This is the base PR in the stacked provider-neutrality series. It does not add the OpenAI adapter yet.

What changed

  • Added typed ModelProvider, ModelIdentity, and inference-setting contracts.
  • Added explicit LLM adapter identity reporting.
  • Made unsupported derive() behavior fail explicitly instead of silently sharing planner configuration.
  • Added model-bound capabilities for composed roles.
  • Added a runtime model-role manifest covering:
    • Planner
    • Architect
    • Qualifier
    • Summarizer
    • Abort detector
    • Localizer
    • Embedder
    • Oracle
  • Recorded requested and resolved provider/model identities.
  • Recorded whether roles are shared, derived, independent, disabled, or unknown.
  • Attached the resolved manifest to IntentResult.
  • Added provider-neutral tool dialect interfaces and Gemini dialect support.
  • Added embedding capability detection.
  • Added structured tests for identity, role resolution, manifest emission, and backward compatibility.

Why

Benchmarking must know exactly which model and model roles were actually used. Previously, provider and role behavior could be inferred incorrectly from adapter class names or silently fall back to shared planner configuration.

This PR creates the contract required for fair cross-provider comparisons and makes unresolved adapter behavior visible instead of silently producing unfair runs.

Scope

This PR intentionally does not include:

  • OpenAI API implementation
  • OpenAI prompt/tool encoding
  • Strict UI grounding changes
  • Documentation updates

Those are included in the subsequent stacked PRs.

Validation

  • Full unit test suite passes.
  • Provider identity and role-manifest tests added.
  • No secrets, credentials, logs, screenshots, or generated artifacts included.

Stack

This PR is based directly on main.

Follow-up PRs:

  1. OpenAI provider support
  2. Provider-neutral strict UI grounding
  3. Documentation and configuration updates

Changed files and roles

Source

  • src/fathom/adapters/llm/gemini.py — Gemini LLM adapter and model identity.
  • src/fathom/adapters/summarization/llm.py — LLM-based summarization adapter.
  • src/fathom/adapters/tools/__init__.py — Exports available tool dialects.
  • src/fathom/adapters/tools/gemini.py — Converts canonical tools to Gemini format.
  • src/fathom/constants/llm.py — LLM provider and inference constants.
  • src/fathom/constants/manifest.py — Model-role manifest enums and constants.
  • src/fathom/core/embedding/capability.py — Detects embedding support.
  • src/fathom/core/services/qualifier/llm.py — LLM-powered intent qualification.
  • src/fathom/interfaces/embedding.py — Embedding provider contract.
  • src/fathom/interfaces/llm.py — Provider-neutral LLM contract.
  • src/fathom/interfaces/tools.py — Provider-neutral tool encoding contract.
  • src/fathom/runtime/builder.py — Builds and assigns runtime model roles.
  • src/fathom/runtime/manifest.py — Produces the resolved model-role manifest.
  • src/fathom/runtime/runner.py — Runs workflows and attaches the manifest.
  • src/fathom/schemas/llm.py — Model identity and inference-setting schemas.
  • src/fathom/schemas/localization.py — Localization result and identity schemas.
  • src/fathom/schemas/manifest.py — Model-role manifest data models.
  • src/fathom/schemas/results.py — Final run-result schema.

Tests

  • tests/unit/adapters/llm/test_gemini.py — Tests Gemini identity and derivation.
  • tests/unit/adapters/tools/test_gemini.py — Tests Gemini tool encoding.
  • tests/unit/core/embedding/test_capability.py — Tests embedding detection.
  • tests/unit/interfaces/test_llm.py — Tests the LLM interface contract.
  • tests/unit/runtime/qualifier/test_composer.py — Tests qualifier composition.
  • tests/unit/runtime/test_assembly.py — Tests runtime configuration assembly.
  • tests/unit/runtime/test_builder.py — Tests model-role construction.
  • tests/unit/runtime/test_manifest.py — Tests manifest generation and correctness.
  • tests/unit/runtime/test_runner.py — Tests manifest attachment during execution.
  • tests/unit/strategies/intent/test_intent.py — Tests intent and checkpoint compatibility.

Signed-off-by: Sakib Khan <sakibalig2003@gmail.com>
Signed-off-by: Sakib Khan <sakibalig2003@gmail.com>
Signed-off-by: Sakib Khan <sakibalig2003@gmail.com>
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.

1 participant