Originally created by: XiaoHuo888-hue
Adds a ready-to-use named OrcaRouter example to the LLM-Enhanced TOC Extraction section of both the English (README.md) and Chinese (README_zh-CN.md) docs.
OrcaRouter is an OpenAI-compatible model gateway. pdf-craft's optional TOC LLM already speaks the OpenAI chat-completions protocol, so no code changes are needed — only the endpoint, API key, and model:
toc_llm = LLM(
key="sk-orca-...", # Your OrcaRouter API key
url="https://api.orcarouter.ai/v1", # OrcaRouter API base
model="orcarouter/auto", # Routed to a frontier model
token_encoding="o200k_base",
timeout=60.0,
retry_times=3,
retry_interval_seconds=5.0,
)
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.
Makes it a one-liner for pdf-craft users to enable LLM-enhanced TOC extraction through OrcaRouter, exactly mirroring how the existing docs present any OpenAI-compatible provider.
python3 test.py — 271/271 tests pass (baseline unchanged).https://api.orcarouter.ai/v1 with model orcarouter/auto using the real LLM code path → HTTP 200, response ORCA-LIVE-OK.Disclosure: I'm an engineer on the OrcaRouter team.
Originally posted by: coderabbitai[bot]
Summary by CodeRabbit
Walkthrough
Added English and Chinese README examples for configuring OrcaRouter as an OpenAI-compatible provider for LLM-enhanced TOC extraction. The examples define the endpoint, API key format, routed model, token encoding, and retry settings for
toc_llm.Merge Risk: 🔵 Low · up to
e51f6The PR only adds OrcaRouter examples to the English and Chinese documentation. It is mergeable with owner follow-up for two bounded documentation-accuracy issues: an omitted parameter in the summary and wording that may overstate automatic routing; no code or runtime behavior changes are introduced.
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
| Check name | Status | Explanation | | :------------------------: | :------- | :----------------------------------------------------------------------------------------------------------------------- | | Description check | ✅ Passed | The description clearly explains the documentation changes, configuration example, motivation, and verification results. | | Title check | ✅ Passed | The title uses the required English format and accurately summarizes the documentation change. | | Linked Issues check | ✅ Passed | Check skipped because no linked issues were found for this pull request. | | Out of Scope Changes check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |✨ Finishing Touches
✨ Simplify code
- [ ] Create PR with simplified codeThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)Comment
@coderabbitai helpto get the list of available commands.