Skip to content

feat(models): add FutureInfra OpenAI-compatible model wrapper - #1163

Open
uxidev wants to merge 1 commit into
ScrapeGraphAI:pre/betafrom
uxidev:add-futureinfra-provider
Open

uxidev wants to merge 1 commit into
ScrapeGraphAI:pre/betafrom
uxidev:add-futureinfra-provider

Conversation

@uxidev

@uxidev uxidev commented Oct 1, 2026

Copy link
Copy Markdown

This PR adds a FutureInfra model wrapper.
It follows the Cheaper Inference wrapper from #1158 and the Atlas Cloud wrapper from #1104.

FutureInfra (https://futureinfra.ai/) is a cloud provider with an OpenAI-compatible AI API router.
Its base URL is https://futureinfra.ai/v1/ai. Model ids use the provider/model format, e.g. openai/gpt-4o-mini.

Changes

  • Add scrapegraphai/models/futureinfra.py. It is a ChatOpenAI subclass with a fixed base URL.
  • Export FutureInfra from scrapegraphai.models.
  • Add a futureinfra entry with two models to models_tokens.py (openai/gpt-4o-mini and openai/gpt-4o, 128000 each, as reported by the context_length field of the public GET https://futureinfra.ai/v1/ai/models endpoint).
  • Add tests/test_futureinfra_model.py.

Usage

import os

from scrapegraphai.graphs import SmartScraperGraph
from scrapegraphai.models import FutureInfra

llm = FutureInfra(api_key=os.getenv("FUTUREINFRA_API_KEY"), model="openai/gpt-4o-mini")

graph_config = {
    "llm": {"model_instance": llm, "model_tokens": 128000},
}

Testing

  • pytest tests/test_futureinfra_model.py tests/test_cheaperinference_model.py tests/test_atlascloud_model.py --no-cov: 6 passed.
  • ruff check passes on the changed files. black --check and isort --check-only pass on the new files.
  • Live call test not attached (no API key used).
Details
  • Base branch: pre/beta.
  • This PR does not register the provider in abstract_graph.py. This matches Add Atlas Cloud OpenAI-compatible model wrapper #1104 and feat(models): add Cheaper Inference OpenAI-compatible model wrapper #1158.
  • The Test Suite workflow runs a fixed list of test files. This PR does not change the workflow. A maintainer can add tests/test_futureinfra_model.py to the list.
  • black --check reports scrapegraphai/models/__init__.py. The __all__ line is already too long on pre/beta.
  • ruff check scrapegraphai tests reports 6 F401 errors in batch_generate_answer_node.py and batch_api.py. They are already on pre/beta. This PR does not change those files.
  • Tests ran in a local uv venv with the locked versions of langchain-openai, pytest, ruff, black and isort (not a full uv sync).
  • This change was drafted with Claude Code and reviewed before submission.

🤖 Generated with Claude Code

Add a FutureInfra ChatOpenAI subclass with base URL https://futureinfra.ai/v1/ai, export it from scrapegraphai.models, add two models to models_tokens, and add unit tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

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