Skip to content

feat(providers): add ofox.ai as LLM preset and video generation provider - #132

Merged
0xsline merged 7 commits into
0xsline:mainfrom
celeste1900:feat/ofox-provider
Sep 8, 2026
Merged

feat(providers): add ofox.ai as LLM preset and video generation provider#132
0xsline merged 7 commits into
0xsline:mainfrom
celeste1900:feat/ofox-provider

Conversation

@celeste1900

Copy link
Copy Markdown
Contributor

Summary

LLM preset (ofox) — mirrors the openrouter entry exactly: an openai-compatible preset (https://api.ofox.ai/v1), keystore whitelist entries, an asset-free vendor monogram (same approach as atlas/xai), the vision label, and the standard verify assertions.

Video provider (ofox) — same async request-id + poll shape as grok-imagine-video, implemented in its own module (server/plugins/ofox-video-provider.ts) the same way: POST /videos → task id → poll GET /videos/{id} → download from unsigned_urls. Wired capabilities:

  • Text-to-video, first-frame / first-and-last-frame image-to-video, and up to 9 image references. Frame anchors and references are mutually exclusive at the API level (400 references_conflict); validation enforces that before any paid submission. generateAudio and seed pass through. refVideos/refAudios are supported by the OFox API but not wired yet.
  • Local project media rides as base64 data URLs — the OFox gateway re-hosts data URIs on its own object storage before dispatching to the upstream model (verified live), so no public hosting is needed; this reuses the existing mediaDataUrl helper the seedance/hailuo paths already use.
  • Full wiring follows the existing per-provider pattern: validation (validateOfox, rejecting all seedance/kling/hailuo-only options), resumer registration, capabilities, submit_video tool schema, settings vendor page with model discovery through the /models probe (parseModelCatalog), agent skill reference (references/ofox.md), i18n (en/it/ru), .env.example, and verify coverage.

Design notes:

  • OFox is a multi-model gateway (Seedance series, Wan, and more behind one key), so the video model is a free-form catalog id; the settings page's "test connection" lists the catalog (138 models at the time of writing).
  • Per-model duration/resolution limits are enforced server-side by the OFox API with a clear 400 before any task is created, so no local per-model whitelist is kept (it would go stale as the catalog evolves). Local validation keeps the cross-provider contract (2–30s bounds, ratio set, reference-mode exclusivity).

Test plan

  • npm run lint
  • npm test (full verify chain, including the regenerated server tool catalog)
  • npm run verify:agent-skill
  • npm run build (tsc -b + vite)
  • Live end-to-end with a real OFox key:
    • settings "test connection" discovered the model catalog (138 models, 514 ms);
    • text-to-video: POST /generate/video with model: "ofox" (4 s, 9:16, 720p) → job succeeded → saved to the media pool (720×1280 h264 + aac, 4.09 s);
    • image-to-video: firstFrame from a project upload (base64 data URL path) → job succeeded, output first frame matches the reference scene.
    • Screenshots attached in the first comment.

Notes

I work on ofox.ai — this is an official contribution and we'll maintain it long-term (ping me anytime). Test credits: happy to provide credits so you can verify the integration yourself — register at ofox.ai and share the account email here (or reply however you prefer), and we'll top up the account right away.

Developed with AI assistance (Claude), reviewed by the OFox team.

🤖 Generated with Claude Code

celeste1900 and others added 7 commits September 2, 2026 11:52
Add OFox (https://ofox.ai), a multi-model gateway, as:

- an OpenAI-compatible LLM preset (mirrors the openrouter entry; keystore
  whitelist, vendor icon monogram, vision label, verify assertions)
- a video generation provider (async task id + polling, same shape as
  grok-imagine-video, implemented in its own server/plugins module):
  text-to-video, first-frame / first-and-last-frame image-to-video, and
  up to 9 image references (frames and references are mutually exclusive
  at the API level, enforced before submission); generateAudio and seed
  pass through. Local project media rides as base64 data URLs, which the
  OFox gateway re-hosts on its own object storage (verified live).
  Validation, resumer registration, capabilities, tool schema, settings
  page with model discovery via the /models probe, agent skill reference,
  i18n (en/it/ru), .env.example, and verify coverage included.

refVideos/refAudios are supported by the OFox API but not wired yet;
per-model duration/resolution limits are enforced by the API with a clear
400 before any task is created, so no local per-model whitelist is kept.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
mirror_urls are persistent signed CDN addresses returned when the
upstream has mirroring enabled; unsigned_urls are temporary upstream
links that may expire within 24 hours. Prefer the former and fall back
to the latter, matching the official retrieve-endpoint recommendation.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Keep explicit OFox requests on the OFox provider, expose it only for video, and fail before outbound requests when its key is missing. Reject malformed provider task IDs and preserve resume polling without resubmission.

Shared paths: the existing model fallback and other provider strategies remain unchanged; OFox capability is enabled only with its configured key. Regressions cover legacy defaults, OFox field preservation, capability isolation, credential guards, task IDs, and resume behavior.

Validation: forced TypeScript build, zero-warning lint, 88 affected verifies, focused provider checks, generated catalog check, and production build passed. A real DeepSeek browser run executed ToolSearch, submit_video(model=ofox), and track_progress; the actual video POST preserved ofox and reported the expected missing-key error with provider=ofox. No paid OFox generation was performed. Existing font warnings and duplicate post-settle draft cleanup 403 are outside this change.
Include the OFox credential, task ID, and resume regressions in the npm test gate. No production behavior changes.

Validation: verify-registration.verify.mjs and verify-gate-coverage.verify.mjs passed for all 572 verify files; ofox-video-provider.verify.ts passed.
Preserve both OFox provider checks and all reliability regression scripts while resolving the test:serial registration conflict.

Validation: both registration gates passed for 574 files, five focused OFox/provider/capability verifications passed, and the generated server tool catalog is current.
@0xsline
0xsline merged commit 9b4eda9 into 0xsline:main Sep 8, 2026
4 checks passed
0xsline added a commit that referenced this pull request Sep 8, 2026
Remove the provider preset, video adapter, settings entries, generated tool schema entries, skill reference, and documentation added by PR #132. Preserve the independently merged Copilot backend and all other fixes and montage workflows.

Shared-path safeguards reject explicitly unavailable video and LLM providers before task creation or outbound requests, so persisted jobs and stale clients cannot silently switch to another paid provider. Missing-provider defaults remain unchanged. Startup loading ignores unavailable capability providers while preserving valid overrides; settings writes retain strict validation.

Validation: npm test passed its pretest and posttest suites and all 178 parallel segments. Forced TypeScript, zero-warning lint, generated catalog and 575-file gate registration checks passed. Focused stale-provider and configuration regressions passed. An isolated production build and real Agent browser calls confirmed that OFox is absent, old-job reruns fail without creating a job, the legacy LLM request returns HTTP 400, and existing video routing fails safely on missing credentials. No paid generation or user-project data was used.
@0xsline

0xsline commented Sep 8, 2026

Copy link
Copy Markdown
Owner

@celeste1900, thank you for the contribution. I've removed the OFox integration from main; if the purpose is to promote your service through the project, please contact me by email first so we can discuss a commercial partnership and revenue sharing before considering the integration again.

@celeste1900

Copy link
Copy Markdown
Contributor Author

Understood — we'll reach out by email. Thanks for the review and verification.

0xsline added a commit that referenced this pull request Sep 10, 2026
Restore the OFox LLM preset and multi-model video gateway from PR #132 now that the commercial sponsorship is confirmed.

Shared-path impact: the safeguards added by the removal (requireLlmProvider at request boundaries, HTTP 400 for unsupported LLM providers, ignoreUnavailableProviders when seeding persisted capability overrides) are preserved, so stale or unknown providers still fail fast instead of silently falling back. OFox remains fully opt-in (no key configured means no behavior change).

Sponsor placement: OFox pinned 4th in Settings Agent brain via settingsAgentProviders ordering only (LLM_PROVIDER_PRESETS order untouched); Sponsors section with vendor logo and UTM copy moved above the intro in README.md and README_ZH.md.

Validation: npx tsc -b --force clean; npm run lint clean; ofox-video-provider, video, keystore, key-probes, llm-proxy, capabilities, generation-tool-input, ai-sdk and executor verifies pass; verify:server-tool-catalog current; verify:skills and verify:i18n pass.
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.

2 participants