trampoline-ai/fractal · Archived

fractal_add_provider

Guide contributors through adding or updating Fractal model providers, provider auth wiring, and provider model options.

First seen Jun 26, 2026

Installation

$ npx skills add trampoline-ai/fractal --skill fractal_add_provider

Summary

  • Guide contributors through adding or updating Fractal model providers, provider auth wiring, and provider model options.
  • Use when adding a Fractal provider, changing provider defaults/model_options/restricted_models, updating setup model menus, or preparing provider-related commits and PRs.

Stronger alternatives

This repository is archived — consider an actively maintained alternative.

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from trampoline-ai/fractal.

npx skills add trampoline-ai/fractal

Browse all from trampoline-ai/fractal

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 200
License LICENSE
Default branch main
Open issues 3
Status Archived

Skill metadata

Parsed from SKILL.md frontmatter.

Declared agents claude-code

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 4,623 B
  • docs SUMMARY.md 319 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 1 installs

SKILL.md

Fractal Provider Changes

Start Here

  1. Inspect the current branch and worktree with git status --short; preserve unrelated user changes.
  2. Read src/fractal/providers.py, src/fractal/onboarding.py, src/fractal/config.py, tests/testproviders.py, tests/testcli_config.py, and README.md.
  3. For model IDs, check current provider documentation or catalogs before editing. Do not rely on memory for active model names.
  4. Decide whether the task is only a model-menu update or a new provider/runtime behavior.

Provider Registry Pattern

Most provider changes live in src/fractal/providers.py.

  • Add a provider id constant near the existing provider constants.
  • Add the provider to _PROVIDERS with a ProviderDefinition.
  • Use default_model for the default menu selection.
  • Use modeloptions for curated alternatives only; do not duplicate defaultmodel.
  • Use restricted_models only when Fractal must reject all other model IDs at runtime.
  • Set model_prefix to the DSPy/LiteLLM provider prefix when runtime strings need normalization, such as openai, anthropic, or openrouter.
  • Keep model_options curated. It is a setup menu, not an exhaustive provider catalog.

Provider behavior choices:

  • API key plus LiteLLM-compatible string: reuse ApiKeyStringLMBehavior.
  • OpenAI-compatible custom endpoint: follow CustomOpenAICompatibleBehavior.
  • CLI/OAuth-backed provider: add a dedicated behavior class that validates shape, checks readiness without leaking secrets, and builds the runtime LM object.

Secrets must not be stored in Fractal config. Store references only: env var names, auth source names, or paths to external auth stores.

Model ID Rules

  • OpenAI API options should be OpenAI model IDs without openai/; normalizemodel adds the prefix.
  • Anthropic options should be Claude API IDs without anthropic/; normalizemodel adds the prefix.
  • OpenRouter options should be OpenRouter catalog IDs like openai/gpt-5.5 or anthropic/claude-sonnet-4.6; normalizemodel adds openrouter/.
  • Custom OpenAI-compatible endpoints cannot have a complete static model catalog. Keep a custom model entry in onboarding.
  • If a provider has a dynamic catalog, do not hardcode the full live response into model_options; pick stable, coding-relevant defaults and document that the list is curated.

Onboarding And Config

New providers appear in setup through list_providers(). Update onboarding only when the provider needs extra inputs beyond base URL and API-key env var.

  • Provider/model menus use model_choices().
  • The line-mode fallback must keep working for non-TTY tests and automation.
  • For any new config fields, update ProviderConfig, redaction/rendering, schema validation, and tests.
  • Never add raw secret fields such as tokens, API keys, passwords, or credentials to config.

Tests

Add or update focused tests before broad tests:

  • tests/testproviders.py: registry membership, modelchoices, model normalization, shape validation, credential readiness, and unsupported model errors.
  • tests/testcliconfig.py: setup output/input flow, model selection, config writes, and secret redaction.
  • If config schema changes, update tests/test_config.py.
  • If runtime behavior changes outside provider resolution, add narrow smoke/runtime coverage.

Validation commands:

.venv/bin/python -m pytest tests/test_providers.py tests/test_cli_config.py
.venv/bin/python -m pytest

Docs

Update README.md when a provider, auth source, default credential reference, or setup model menu changes. State when a menu is curated rather than exhaustive.

Commit And PR Workflow

Only commit when the user asks.

  1. Re-check git status --short and stage only files changed for this task.
  2. Commit with a provider-scoped message, for example Add <provider> provider support or Update <provider> model options.
  3. Push the current branch only when the user asks.
  4. Open a PR only when the user asks, using the repo's normal CLI if available, usually gh pr create --fill.
  5. In the PR body, include provider behavior, auth/secrets handling, model sources, and tests run.

If current branch ownership is unclear, ask before creating, switching, pushing, or opening a PR.