Skip to content

feat(providers): add Cheaper Inference provider - #205

Open
aiapienthusiast wants to merge 1 commit into
sapientinc:mainfrom
aiapienthusiast:cheaperinference-provider
Open

aiapienthusiast wants to merge 1 commit into
sapientinc:mainfrom
aiapienthusiast:cheaperinference-provider

Conversation

@aiapienthusiast

Copy link
Copy Markdown

Summary

This PR adds Cheaper Inference as a model provider plugin.
It uses the same pattern as #200 (the OrcaRouter part).

Cheaper Inference is an OpenAI-compatible LLM gateway.
One API key gives access to models from several labs.
It also serves Anthropic Messages, so it works with claude_sdk and codex_sdk.

Usage:

export CHEAPER_INFERENCE_API_KEY=...
praxist setup --profile cheaperinference-api

Scope

  • Affected modules or public contracts: new model_provider:cheaperinference plugin, cheaperinference-api setup profile, CHEAPER_INFERENCE_API_KEY credential.
  • Compatibility considerations: additive only. Existing provider selection order does not change. The new key is checked after ORCAROUTER_API_KEY.
  • Task-agnostic rationale, when shared Praxist behavior changes: no task-specific logic. Model ids pass through unchanged.

Verification

  • uv run pytest tests/unit tests/conformance -q: pass, except 2 tests that also fail on main here (missing optional uvicorn and boto3).
  • uv run pytest tests/hardening -q: pass.
  • uv run ruff check praxist/ tests/ and uv run ruff format --check praxist/ tests/: pass.
  • uv run pyrefly check: no new errors (existing missing-import errors in praxist/product_usage).
  • uv run python scripts/build_docs_site.py --check-generated: pass.
  • Live check: gpt-5.4-mini returned a reply through both provider paths.
  • Not run: full coverage gate and real research tasks.

Checklist

  • The change is focused and does not include unrelated generated files.
  • Tests cover the affected behavior.
  • Documentation, templates, examples, and skills were updated where needed.
  • No credentials, private task data, or research-run artifacts are included.
  • New dependencies and copied assets include their source and license terms.
  • I have read .github/CONTRIBUTING.md and the contribution terms in LICENSE.md.
Details

Files:

  • praxist/plugins/model_providers/cheaperinference/: plugin manifest and adapter. Default model gpt-5.4-mini.
  • praxist/cli/_env.py, setup.py, start.py: key map, provider ref, base URL, setup profile, default provider and model.
  • praxist/core/credentials.py, modeling.py, redaction.py: credential discovery, model id pass-through, ci_live_ key redaction.
  • praxist/plugins/agent_runtimes/*: runtime allowlists, codex relay upstream and key var.
  • praxist/plugins/workflow_stages/research_loop/*: provider env freeze, scoped env, default provider.
  • Docs, skills, and docs/reference/cli.md (regenerated).

Tests: the same test files as #200, with Cheaper Inference cases.

Not copied from #200: the OpenRouter-style reasoning.effort relay override and the lossless context policy.
Those depend on provider behavior that maintainers may want to confirm first.

Live check: gpt-5.4-mini returned a reply through freeze_provider_env (Anthropic Messages, claude_sdk path).
It also returned a reply through the codex relay upstream (Chat Completions).

This branch has not been deployed

No deployments
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