Skip to content

Replace llm.py with orc.py (SAP AI Core Orchestration Service v2)#274

Open
snmcntrk wants to merge 7 commits into
SAP:developfrom
snmcntrk:main
Open

Replace llm.py with orc.py (SAP AI Core Orchestration Service v2)#274
snmcntrk wants to merge 7 commits into
SAP:developfrom
snmcntrk:main

Conversation

@snmcntrk
Copy link
Copy Markdown
Collaborator

. 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).

@snmcntrk snmcntrk requested a review from marcorosa May 21, 2026 12:39
@snmcntrk snmcntrk requested a review from a team as a code owner May 21, 2026 12:40
@marcorosa marcorosa changed the base branch from main to develop May 25, 2026 10:19
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