Skip to content

Add OrcaRouter agent example - #896

Open
JinhaoSong322 wants to merge 1 commit into
apache:mainfrom
JinhaoSong322:add-orcarouter-provider
Open

Add OrcaRouter agent example#896
JinhaoSong322 wants to merge 1 commit into
apache:mainfrom
JinhaoSong322:add-orcarouter-provider

Conversation

@JinhaoSong322

Copy link
Copy Markdown

Summary

Adds a new example, examples/orcarouter-agent/, that shows how to build a small
stateful chat agent with Burr backed by OrcaRouter.

OrcaRouter is an OpenAI-compatible gateway (https://api.orcarouter.ai/v1) that
routes to a wide range of models through a single API key. It also runs
gateway-level, zero-trust security for AI agents on the same endpoint — screening
every prompt/response and governing every tool call on a default-deny basis, with
no application code changes.

Because the endpoint is OpenAI-compatible, the example uses the standard openai
client with base_url pointed at OrcaRouter and the orcarouter/auto model
alias. The agent loops between human_input and ai_response actions,
accumulating a chat_history in state.

Changes

  • examples/orcarouter-agent/application.py — Burr state machine with two
    actions (human_input, ai_response) calling https://api.orcarouter.ai/v1
    via the openai client (ORCAROUTER_API_KEY, optional
    ORCAROUTER_BASE_URL/ORCAROUTER_MODEL).
  • examples/orcarouter-agent/README.md, notebook.ipynb,
    requirements.txt, __init__.py, statemachine.png — standard example
    contents (mirrors examples/simple-chatbot-intro/).
  • examples/README.md — added the example to the index.
  • docs/ecosystem.rst — added an OrcaRouter row to the LLM & AI Frameworks table.

How I tested this

  • python -m pytest validate_examples.py in examples/ — 48 passed (includes
    orcarouter-agent).
  • black, isort, flake8 clean on the new example.
  • scripts/check_asf_headers.py — clean.
  • Live test with a real OrcaRouter key through the example's code path
    (application.run(..., halt_after=["ai_response"])) — returned a valid
    completion from https://api.orcarouter.ai/v1.

Notes

No existing Burr code was changed; this only adds a new example and two doc
index entries.

Checklist

  • PR has an informative and human-readable title (this will be pulled into the release notes)
  • Changes are limited to a single goal (no scope creep)
  • Code passed the pre-commit check & code is left cleaner/nicer than when first encountered.
  • Any change in functionality is tested
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged / future TODOs are captured in comments
  • Project documentation has been updated if adding/changing functionality.

Disclosure: I'm an engineer on the OrcaRouter team.

Add a minimal stateful chat agent example that points the OpenAI-compatible
openai client at OrcaRouter (https://api.orcarouter.ai/v1), using the
orcarouter/auto model alias. Register the example in the examples index and
the ecosystem docs table.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: JinhaoSong322 <jinhao.song@myflashcloud.com>
@github-actions github-actions Bot added area/website burr.apache.org website area/examples Relates to /examples labels Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/examples Relates to /examples area/website burr.apache.org website

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant