This release is a pre-release and may not be stable for production use.
open-commerce-agent
Provider-agnostic reference commerce agent. A fork of
anthropics/commerce-agents
designed for OpenAI Chat Completions–compatible endpoints —
OpenRouter, Chutes, LiteLLM, vLLM, Ollama, LM Studio, self-hosted.
(Only OpenRouter has been validated end-to-end so far — see the
capability matrix.)
Apache-2.0. Vendored subset of Anthropic's original at a pinned commit
(see UPSTREAM.md); wrapped with a streaming Anthropic Messages ⇄
OpenAI Chat Completions translator so the upstream ShoppingAgent
orchestrator's tool-loop, gates, and prompt work unchanged against
non-Anthropic backends.
Status: Alpha. Live on PyPI as
open-commerce-agent. Runtime shim, request + response translation, both shopping + merchant orchestrators bundled, and end-to-end wiring against Claude (via OpenRouter) and OSS models (via OpenRouter) are proven working. First real user validation and capability-matrix rows for non-OpenRouter providers still to come.
Why
The upstream reference provides Messages API, Claude Agent SDK, and Managed Agents runtimes for Claude. This independent fork vendors the shopping and merchant Messages API subset and adds a client shim for OpenAI Chat Completions–compatible endpoints — so the same tools, prompts, gates, and orchestrators can run against models reached through OpenRouter, Chutes, LiteLLM, vLLM, or a self-hosted server.
This fork retains a pinned, attributed subset of upstream's shopping and merchant tools, prompts, gates, memory, and Messages API orchestrators, and translates model-client calls. It does not include the upstream Agent SDK, Managed Agents, examples, or other omitted components.
Install
pip install --pre open-commerce-agent
(--pre needed while the current version is an alpha —
0.1.0a1. Drop the flag once v0.1.0 final lands.)
The wheel bundles the vendored Anthropic subset as top-level
commerce_common / shopping_agent / shopping_agent_runtime /
merchant_agent / merchant_agent_runtime packages, so no
post-install step is required. Both the shopping and merchant
orchestrators use the same OpenAIChatCompatClient — one shim
covers both agent families.
Source install (contributors, or before PyPI publish):
python -m venv .venv && source .venv/bin/activate
pip install -e '.[dev]'
bash scripts/install.sh # installs the vendored subset editable
Editable-install needs the shell script because the vendored code
sits under vendored/upstream/ at development time; the script
pip install -es the three sibling packages so changes there flow
without a reinstall. The wheel-install path doesn't need it — hatch
bundles them into the wheel.
Quickstart
Copy configs/openrouter.env.example → .env, fill in a key + model,
then run the smoke against a built-in mock catalog:
source .env # OPENAI_BASE_URL, OPENAI_API_KEY, MODEL
oca smoke # or: python examples/smoke.py
You should see the model call search → add_to_cart and end with a
one-line assistant summary. That validates your provider+model combo.
To wire your own catalog, implement the StorefrontBackend protocol
against your data (examples/mock_backend.py is a minimal reference,
docs/adding-a-backend.md is the full
guide), then:
from open_commerce_agent import build_client_from_env
from shopping_agent.config import ShoppingAgentConfig
from shopping_agent_runtime.orchestrator import ShoppingAgent
client, model = build_client_from_env()
agent = ShoppingAgent(
backend=YourStorefrontBackend(),
client=client,
config=ShoppingAgentConfig(model=model),
)
# ... call agent.stream_turn(messages, session, state) per turn
See examples/smoke.py for the full session loop.
Capability matrix
Community-maintained — file a PR against this section when you add or update a row. Pass rate is from an internal reference task set (a public benchmark harness is a follow-up).
Section stub — real matrix landed after the first CI round of live
smokes; see docs/capability-matrix.md for the current view.
| Model | Provider | Tool-calling | Streaming | Notes |
|---|---|---|---|---|
anthropic/claude-sonnet-4-5 |
OpenRouter | ✅ | ✅ | OpenRouter route used as the current cross-model smoke baseline; tool-calling and streaming observed. |
moonshotai/kimi-k2 |
OpenRouter | ✅ | ✅ | Native tool_calls. Notably good product-selection prose. |
| … | … | … | … | file a PR |
Provider recipes
See configs/ for ready-to-copy environment configurations for each
supported provider:
configs/openrouter.env.example— OpenRouter (Claude, Kimi, DeepSeek, Qwen, GLM, Gemma, all via one endpoint)configs/litellm.env.example— self-hosted LiteLLM proxyconfigs/vllm.env.example— self-hosted vLLM with a chat templateconfigs/openai.env.example— hosted OpenAI (fallback)
None is a "default" — the point of this package is you pick.
What upstream did well that we kept
StorefrontBackend— clean abstract interface with one method per domain operation. Any catalog can implement it in under a day.- Provenance gates that block hallucinated product IDs and cart writes on unseen items. Safety-relevant, keep it.
- Skills-as-prompt-modules pattern — the
SKILL.mdfiles undervendored/upstream/shopping-agent/skills/andvendored/upstream/merchant-agent/skills/are what make the agents feel domain-competent. Publish fork-specific skill additions here and track upstream changes inUPSTREAM.md. - The full turn loop + presentation-tool streaming + memory extraction.
What we changed (all in the wrapper layer, none in the vendored code)
runtime_openai_shim/— the translation shim. SeeCHANGES.mdfor details.- No default model, no cache_control fakery, no Agent SDK or Managed Agents runtimes.
The shopping and merchant core, skills, and Messages API runtimes are vendored; Agent SDK and Managed Agents runtimes are not.
License
vendored/upstream/*— Apache-2.0, Anthropic PBC (see the vendoredLICENSE).src/open_commerce_agent/*— Apache-2.0, ORO AI.
Neither Anthropic nor Claude endorse or maintain this fork. This is an independent adaptation for the OpenAI-compat wire protocol.
Migrating from anthropics/commerce-agents
Already running the upstream reference and want to switch providers?
The diff is roughly six lines. See
docs/migrating-from-upstream.md.
Observability
OpenAIChatCompatClient(..., on_request=…, on_response=…) — plug in
logging / tracing / cost accounting per model call without patching
the shim. See docs/observability.md.
Reference
docs/agents.md— shopping vs merchant agent families, backend contracts, wiring shape.docs/glossary.md— terms used across the codebase and docs (StorefrontBackend, provenance gate, orchestrator, shim, presentation vs data, session vs state, …).docs/architecture.md— box diagram and the shim's place in the request path.docs/troubleshooting.md— symptom → fix for the failure modes we've actually seen (empty responses, cart stays empty, tool-calls dropped, provider quirks).docs/versioning.md— SemVer policy, vendored SHA sync cadence, release checklist.docs/testing.md— test tier map for contributors.docs/adr/— architecture decision records.
Related
- Upstream: https://github.com/anthropics/commerce-agents
- Upstream tracking + sync:
UPSTREAM.md - Local changes:
CHANGES.md
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file open_commerce_agent-0.1.0a1.tar.gz.
File metadata
- Download URL: open_commerce_agent-0.1.0a1.tar.gz
- Upload date:
- Size: 281.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
001d30da7f04a6bb6058b2f5195fa20ecc9a2b5a76684fb30fbd5a7db844f1d4
|
|
| MD5 |
48d08de396b5faac906ca72136baeae0
|
|
| BLAKE2b-256 |
941e342cf6b3e2e5b739c0b425f6ccefe01b6824d51bba83622528cf839fdb42
|
Provenance
The following attestation bundles were made for open_commerce_agent-0.1.0a1.tar.gz:
Publisher:
release.yml on ORO-AI/open-commerce-agent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
open_commerce_agent-0.1.0a1.tar.gz -
Subject digest:
001d30da7f04a6bb6058b2f5195fa20ecc9a2b5a76684fb30fbd5a7db844f1d4 - Sigstore transparency entry: 2840836315
- Sigstore integration time:
-
Permalink:
ORO-AI/open-commerce-agent@8b6150c86b4585eaafb6a36b8f8169be7eccccad -
Branch / Tag:
refs/heads/main - Owner: https://github.com/ORO-AI
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8b6150c86b4585eaafb6a36b8f8169be7eccccad -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file open_commerce_agent-0.1.0a1-py3-none-any.whl.
File metadata
- Download URL: open_commerce_agent-0.1.0a1-py3-none-any.whl
- Upload date:
- Size: 208.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
903e32113a4b000efcdc0851113eb6943ca12e894ba22daad85eb2c81d4c0ade
|
|
| MD5 |
ad0b9cd26cca010b8a84b106f5cd0ce8
|
|
| BLAKE2b-256 |
32be9373e0369a845bc60f8ee04318776c0ea7ae2895c27fc7002ba00c31b310
|
Provenance
The following attestation bundles were made for open_commerce_agent-0.1.0a1-py3-none-any.whl:
Publisher:
release.yml on ORO-AI/open-commerce-agent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
open_commerce_agent-0.1.0a1-py3-none-any.whl -
Subject digest:
903e32113a4b000efcdc0851113eb6943ca12e894ba22daad85eb2c81d4c0ade - Sigstore transparency entry: 2840836331
- Sigstore integration time:
-
Permalink:
ORO-AI/open-commerce-agent@8b6150c86b4585eaafb6a36b8f8169be7eccccad -
Branch / Tag:
refs/heads/main - Owner: https://github.com/ORO-AI
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8b6150c86b4585eaafb6a36b8f8169be7eccccad -
Trigger Event:
workflow_dispatch
-
Statement type: