Skip to main content
Pre-release

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 that runs on any OpenAI Chat Completions–compatible endpoint — OpenRouter, Chutes, LiteLLM, vLLM, Ollama, LM Studio, self-hosted.

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 / WIP. Runtime shim, request + response translation, and end-to-end wiring against Anthropic (via OpenRouter) and OSS models (via OpenRouter) are proven working. Public-facing polish (installer, docs, PyPI package) still landing.

Why

Anthropic's reference implementation binds you to Claude via their Messages API + Claude Agent SDK. That's the right call for the primary use case, but leaves everyone running OSS models — Kimi K3, DeepSeek V3.2, Qwen 3.5, GLM 5.2, Gemma, Mistral — to either roll their own commerce agent from scratch or accept vendor lock-in.

This fork keeps everything upstream ships (tools, prompts, safety gates, presentation, memory, executor) and swaps only the model call — so you can run the exact same agent on the exact same tools against whichever model wins your capability matrix this month.

Install

Wheel install (once we're on PyPI — the workflow is scaffolded):

pip install open-commerce-agent

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 searchadd_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 Reference — matches direct Anthropic API behaviour.
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 proxy
  • configs/vllm.env.example — self-hosted vLLM with a chat template
  • configs/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 five SKILL.md files under vendored/upstream/shopping-agent/skills/ are what makes the agent feel domain-competent. Keep them; contribute skill additions upstream where possible.
  • 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. See CHANGES.md for details.
  • No default model, no cache_control fakery, no merchant agent, no Claude Agent SDK path.

License

  • vendored/upstream/* — Apache-2.0, Anthropic PBC (see the vendored LICENSE).
  • 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/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/adr/ — architecture decision records.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

open_commerce_agent-0.0.1.dev0.tar.gz (262.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

open_commerce_agent-0.0.1.dev0-py3-none-any.whl (205.9 kB view details)

Uploaded Python 3

File details

Details for the file open_commerce_agent-0.0.1.dev0.tar.gz.

File metadata

  • Download URL: open_commerce_agent-0.0.1.dev0.tar.gz
  • Upload date:
  • Size: 262.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for open_commerce_agent-0.0.1.dev0.tar.gz
Algorithm Hash digest
SHA256 2ca36d4756517c72304fc508bbfe8810720a2853dc076278ab8a0610b28baada
MD5 c19f7dedac749dd22364235fb77279de
BLAKE2b-256 3bf3bac8da1a9668741951a5993561d3f322f31428942dc32d07c95a054451af

See more details on using hashes here.

Provenance

The following attestation bundles were made for open_commerce_agent-0.0.1.dev0.tar.gz:

Publisher: release.yml on ORO-AI/open-commerce-agent

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file open_commerce_agent-0.0.1.dev0-py3-none-any.whl.

File metadata

File hashes

Hashes for open_commerce_agent-0.0.1.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 13911ed9d4d8920f3236bfc255bc0c89a99b85528d9452428972981ef09eff1b
MD5 6105b265f9c7d3c382305105be39fe8e
BLAKE2b-256 b16507cb876000660d22b90a40506dff63b2b2d610a68e997662b5985f799cfc

See more details on using hashes here.

Provenance

The following attestation bundles were made for open_commerce_agent-0.0.1.dev0-py3-none-any.whl:

Publisher: release.yml on ORO-AI/open-commerce-agent

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.0.1.dev0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page