Skip to content

feat(model_client): add RuncrateClient for the Runcrate OpenAI-compatible API - #516

Open
heydryft wants to merge 1 commit into
SylphAI-Inc:mainfrom
heydryft:feat/runcrate-client
Open

heydryft wants to merge 1 commit into
SylphAI-Inc:mainfrom
heydryft:feat/runcrate-client

Conversation

@heydryft

@heydryft heydryft commented Nov 8, 2026

Copy link
Copy Markdown

Hi, thanks for building AdalFlow, I added a small client so people can point Generator at Runcrate the same way they do with the xAI or DeepSeek clients.

What does this PR do?

Adds RuncrateClient, a thin subclass of OpenAIClient for Runcrate, an AI cloud with an OpenAI-compatible inference API for open-weight models. It has the same shape as XAIClient: it only changes the default base_url (https://api.runcrate.ai/v1) and the API key variable (RUNCRATE_API_KEY), and overrides no methods. API docs: https://runcrate.ai/docs/models/chat-completions

Changes

  • adalflow/adalflow/components/model_client/runcrate_client.py: new RuncrateClient with a docstring and a Generator usage example.
  • adalflow/adalflow/components/model_client/__init__.py: lazy import (needs only the openai package, like XAIClient) and __all__ entry, so it is also registered in EntityMapping.
  • adalflow/tests/test_runcrate_client.py: defaults, package-level import, sync and async client setup, key from RUNCRATE_API_KEY, custom base_url, and request kwargs.

No new dependency. I did not add an integrations tile because those use logo images; happy to add one if you send the preferred asset.

How tested

In a Python 3.11 venv with pip install -e ".[openai]" pytest pytest-asyncio, from the adalflow/ directory:

  • pytest tests/test_runcrate_client.py tests/test_deepseek_client.py tests/test_model_client.py -q: 13 passed.
  • black --check on the three touched files: clean. Ruff's newer default rules flag the same typing style the existing xai_client.py has, so I kept that style.
  • Live call with a real key: Generator(model_client=RuncrateClient(), model_kwargs={"model": "deepseek-ai/DeepSeek-V4-Flash", "stream": False}) returned pong with no error.

Before submitting

  • Was this discussed/agreed via a GitHub issue? No, it is a small additive client that follows the existing OpenAI-compatible clients. If you would prefer an issue first, I am glad to open one.
  • Did you read the contributor guideline?
  • Did you make sure your PR does only one thing?
  • Did you make sure to update the documentation with your changes? The client docstring is the documentation, as for the other clients.
  • Did you write any new necessary tests?
  • Did you verify new and existing tests pass locally with your changes? The ones listed above.
  • Did you list all the breaking changes? None.

Disclosure: I work on Runcrate.

This PR was prepared with AI assistance (omp with Claude): the client, tests and this description were written with it, and the commands and the live call above were run as described.

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