Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 ofOpenAIClientfor Runcrate, an AI cloud with an OpenAI-compatible inference API for open-weight models. It has the same shape asXAIClient: it only changes the defaultbase_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-completionsChanges
adalflow/adalflow/components/model_client/runcrate_client.py: newRuncrateClientwith a docstring and a Generator usage example.adalflow/adalflow/components/model_client/__init__.py: lazy import (needs only theopenaipackage, likeXAIClient) and__all__entry, so it is also registered inEntityMapping.adalflow/tests/test_runcrate_client.py: defaults, package-level import, sync and async client setup, key fromRUNCRATE_API_KEY, custombase_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 theadalflow/directory:pytest tests/test_runcrate_client.py tests/test_deepseek_client.py tests/test_model_client.py -q: 13 passed.black --checkon the three touched files: clean. Ruff's newer default rules flag the same typing style the existingxai_client.pyhas, so I kept that style.Generator(model_client=RuncrateClient(), model_kwargs={"model": "deepseek-ai/DeepSeek-V4-Flash", "stream": False})returnedpongwith no error.Before submitting
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.