Skip to content

feat(models): add Runcrate as an OpenAI-compatible provider - #1178

Open
heydryft wants to merge 1 commit into
ScrapeGraphAI:pre/betafrom
heydryft:feat/runcrate-model
Open

heydryft wants to merge 1 commit into
ScrapeGraphAI:pre/betafrom
heydryft:feat/runcrate-model

Conversation

@heydryft

Copy link
Copy Markdown

Adds Runcrate as an OpenAI-compatible model provider, following the Cheaper Inference wrapper (#1158), and also wires it into AbstractGraph so it works from a graph config:

graph_config = {
    "llm": {
        "model": "runcrate/deepseek-ai/DeepSeek-V4.1-Flash",
        "api_key": os.getenv("RUNCRATE_API_KEY"),
    },
}

Runcrate is a GPU cloud with an OpenAI-compatible inference API at https://api.runcrate.ai/v1; open models are free with your GitHub account. Keys: https://www.runcrate.ai/dashboard/api-keys?utm_source=Scrapegraph-ai&utm_medium=directory&utm_campaign=gpu_pricing

Changes

  • scrapegraphai/models/runcrate.py: Runcrate(ChatOpenAI), maps api_key and pins the base URL.
  • scrapegraphai/graphs/abstract_graph.py: runcrate in known_providers and the custom-class branch. The existing split("/", 1) keeps vendor-prefixed ids such as deepseek-ai/DeepSeek-V4.1-Flash intact.
  • scrapegraphai/helpers/models_tokens.py: context windows for six models, from the public GET https://api.runcrate.ai/v1/models.
  • examples/smart_scraper_graph/runcrate/smart_scraper_runcrate.py, copied from the NVIDIA example.
  • tests/test_runcrate_model.py: base URL and key mapping, and a graph config that resolves to Runcrate with the full model id and the right token window.

Checks

  • pytest tests/test_runcrate_model.py: 2 passed.
  • pytest tests/graphs/abstract_graph_test.py tests/test_models_tokens.py: the same 6 failures as on pre/beta without this change; nothing new fails.
  • ruff check, black --check and isort --check-only on the touched files: clean. mypy flags the untyped __init__ in runcrate.py, the same pattern as atlascloud.py and cheaperinference.py.
  • Live, with a real key: SmartScraperGraph on a small local HTML page listing three GPUs, prompt asking for name and memory. runcrate/deepseek-ai/DeepSeek-V4.1-Flash and runcrate/zai-org/GLM-5.3-Flash both returned all three GPUs with the correct GB values; graph.llm_model was Runcrate with base https://api.runcrate.ai/v1 and a 1,048,576 token window.

This PR was written with AI assistance (Claude) and tested as described above.

Disclosure: I work on Runcrate.

Adds a Runcrate ChatOpenAI wrapper pinned to https://api.runcrate.ai/v1
and wires it into AbstractGraph, so `runcrate/<vendor>/<model>` (for
example runcrate/deepseek-ai/DeepSeek-V4.1-Flash) resolves to Runcrate
with the vendor-prefixed model id kept intact. Adds context windows for
six models to models_tokens, a SmartScraper example and 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