Replace llm.py with orc.py (SAP AI Core Orchestration Service v2)#274
Open
snmcntrk wants to merge 7 commits into
Open
Replace llm.py with orc.py (SAP AI Core Orchestration Service v2)#274snmcntrk wants to merge 7 commits into
snmcntrk wants to merge 7 commits into
Conversation
Replace llm.py with orc.py (SAP AI Core Orchestration Service v2)
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.
. New orc.py — replaces llm.py with a new Orchestration class that routes all model calls through the SAP AI Core Orchestration Service v2 API (gen_ai_hub.orchestration_v2). This gives a unified pipeline regardless of the underlying model provider (Azure OpenAI, MistralAI, Amazon Bedrock, Google Vertex AI).
. llm.py deprecated — renamed to llm.py.deprecated. Direct per-provider clients (AICoreOpenAILLM, AICoreAmazonBedrockLLM, AICoreGoogleVertexLLM, etc.) are no longer used.
. All call sites updated — attack.py, cli.py, tools.py, and all five libs (garak.py, gptfuzz.py, promptmap.py, pyrit.py, codeattack.py, artprompt.py) now import Orchestration from orc.py instead of LLM from llm.py.
. Trace serialization fixed — _trace_orc_call now serializes pydantic ChatMessage objects to plain dicts before writing to the JSON trace, fixing a TypeError on json.dump.
. Tests added — test_orc.py (6 unit tests, mocked, no network) and test_orc_live.py (2 integration tests against real AI Core endpoint, both passing).