Skip to content

armgit / sie

Public Imported from GitHub
0

Open-source inference server and production cluster for all the models your agent needs.

docs(examples): record the OpenCode example on SIE Cloud, with BFCL through SIE Relay (#732)

Krisztian Gajdar03dd3fd3c795
diff --git a/examples/README.md b/examples/README.md
index 128b3a2bf..fdd41f281 100644
--- a/examples/README.md
+++ b/examples/README.md
@@ -20,7 +20,7 @@ to a separately maintained repository (clone and run there).
| [Extract custom entities from primary sources](./named-entity-extraction) | Changing zero-shot labels across financial, healthcare, rail-safety and legal text, with the two labels that came back empty left visible | `extract` | SIE endpoint with GLiNER multi v2.1; `fetch.py` pulls the recorded run, `score.py` reproduces the counts with no key | Runnable recorded example |
| [Extract the entity types you name, with no model to train](./custom-entity-types) | Asking for the 85 entity types of seven zero-shot NER sets and scoring exact spans against GPT-6 Luna, GPT-6 Sol, Claude Haiku 4.5, SIE Qwen3.8 27B, AWS Comprehend and spaCy, with a paired bootstrap and the price of each | `extract` | SIE server with GLiNER BioMed Large; `fetch.py` pulls the recorded run, `score.py` reproduces the figures with no key | Runnable recorded example |
| [Answer a question from a passage, and quote the sentence you used](./chat) | Checking a generated answer for its citation, its length and whether it declines a question the passage cannot answer | `chat/completions` | SIE Cloud with Qwen3.8 27B; `fetch.py` pulls the recorded run, `score.py` reproduces the numbers with no key | Runnable recorded example |
-| [Run a coding agent on SIE with OpenCode](./coding-agent-opencode) | Pointing OpenCode at a laptop server, a self-hosted cluster or SIE Cloud, and checking the agent loop the way OpenCode drives it: streaming tool-call deltas, parallel calls, tool-result round trips, a 64K-plus prompt, finish reasons, usage and the reasoning field | `chat/completions` | An SIE Cloud endpoint that lists GLM-5.3-Flash via SIE Relay, or a local server; the laptop recipe was run only on Apple Silicon with Qwen3.5-4B, where the server refuses OpenCode's first turn today; `conformance.py` reports every case, `run_gate.sh` makes OpenCode fix a seeded failing test | Runnable check, Cloud results pending |
+| [Run a coding agent on SIE with OpenCode](./coding-agent-opencode) | Pointing OpenCode at a laptop server, a self-hosted cluster or SIE Cloud, and checking the agent loop the way OpenCode drives it: streaming tool-call deltas, parallel calls, tool-result round trips, a 64K-plus prompt, finish reasons, usage and the reasoning field | `chat/completions` | An SIE Cloud endpoint that lists GLM-5.3-Flash via SIE Relay, or a local server; the laptop recipe was run on Apple Silicon with Qwen3.5-4B; `conformance.py` reports every case, `run_gate.sh` makes OpenCode fix a seeded failing test | Runnable check, laptop and SIE Cloud results recorded |
| [Route requests while skipping most generation calls](./request-routing) | Assigning support, banking and assistant requests to routes with an embedding classifier and conditional generation | `encode`, `chat/completions` | SIE server with Qwen3 Embedding 4B and Qwen3.8 27B; recorded 3,000-case verification needs no API key | Runnable recorded example |
| [Send each request to a cheap or a strong LLM](./request-routing/cost) | Cutting LLM spend with a bge-m3 nearest-neighbour router that picks GPT-6 Luna or GPT-6.1 Sol per request: 38.6% less than always using GPT-6.1 Sol at 95.8% of its quality on 728 held-out requests of a pre-registered study | `encode` | SIE Serverless with bge-m3; `fetch.py` pulls the recorded study, `score.py` reproduces the held-out table with no key | Runnable recorded example |
| [Turn PDF pages into Markdown, scored on olmOCR-Bench](./document-to-markdown-olmocr) | Converting all 1,403 pages of Ai2's olmOCR-Bench with LightOnOCR-2-1B and scoring them with Ai2's own scorer, beside published Azure Document Intelligence and AWS Textract runs | `extract` | SIE Cloud with LightOnOCR-2-1B; `fetch.py` pulls the recorded run, `score.py` reproduces the scores with no key | Runnable recorded example |
diff --git a/examples/coding-agent-opencode/README.md b/examples/coding-agent-opencode/README.md
index f9b55bc84..3c118f118 100644
--- a/examples/coding-agent-opencode/README.md
+++ b/examples/coding-agent-opencode/README.md
@@ -295,34 +295,93 @@ OpenCode took 5 steps and 4 tool calls (`bash`, `read`, `edit`, `bash`), 8
seconds from its first event to its last. An earlier run on the same server
took 7 steps and 6 tool calls.
-### SIE Cloud, GLM-5.3-Flash via SIE Relay
+### SIE Cloud, GLM-5.3-Flash via SIE Relay, recorded
-To be recorded on the deployed endpoint:
+`zai-org/GLM-5.3-Flash:relay` on an SIE Cloud endpoint that serves it,
+2026-10-14, from this repository at commit `93325c4b`:
```
-conformance table pending
-x-sie-served-by pending (expected: remote)
-seeded gate pending
-terminal recording pending
-SIE Cloud usage rows pending (expected: served_by relay)
+model zai-org/GLM-5.3-Flash:relay at https://.../v1
+served by remote
+
+ tool_choice_auto pass tool_choice=auto accepted on the tools turn
+ streaming_tool_call_deltas pass 1 call: get_weather({"city": "Paris"}); 3 deltas; finish_reason=tool_calls
+ parallel_tool_calls pass 2 calls in one turn: get_weather({"city": "Paris"}), get_weather({"city": "Tokyo"})
+ tool_result_round_trip pass final answer used the tool result: 'The current weather in Paris is **18°C** with **overcast** conditions.'
+ prompt_above_64k_tokens pass 71444 prompt tokens accepted and answered; needle found
+ finish_reason_stop pass finish_reason=stop after 'ready'
+ finish_reason_tool_calls pass finish_reason=tool_calls on the tool-call turn
+ finish_reason_length pass finish_reason=length at max_tokens=8 (completion_tokens=7)
+ usage_on_final_chunk pass final chunk carries usage {'completion_tokens': 1, 'prompt_tokens': 20, 'total_tokens': 21, 'credits_charged': 1, ...}
+ include_reasoning pass 2 reasoning_content deltas, 14 chars; message.reasoning_content 14 chars; none without the flag
+ tool_choice_required fail request failed: None RESOURCE_EXHAUSTED: the upstream is busy, please retry
+
+10 pass, 1 fail, 0 recorded
+```
+
+- The one failure is the rate limit, not the feature. The check sends its
+ cases back to back and does not retry, and the `:relay` profile admits a
+ bounded number of requests a minute. The same `tool_choice: "required"`
+ request sent alone a few minutes later came back with `finish_reason:
+ tool_calls` and the forced `get_weather` call.
+- A direct chat answer from the same endpoint carried `x-sie-served-by:
+ remote`, `x-sie-upstream: sie-relay` and `x-sie-credits-debited`, and the
+ streamed answers' final usage carried `credits_charged`, so the requests are
+ metered on SIE Cloud like any other.
+- The 71,444-token prompt fits the 131,072-token window the `:relay` profile
+ declares, which is the `limit.context` in the Cloud recipe.
+
+`./run_gate.sh` against the same endpoint, with OpenCode 1.19.0 and no global
+OpenCode config, OpenCode's JSON event lines left out:
+
+```
+== before: the seeded tests
+FAILED tests/test_amounts.py::test_credit_in_parentheses_is_negative - decima...
+FAILED tests/test_amounts.py::test_total_nets_credits - decimal.InvalidOperat...
+2 failed, 1 passed in 0.02s
+== opencode run, recipe cloud, up to 50 steps and 1800 s
+== after: the seeded tests must be untouched
+== after: pytest in a fresh environment, pinned to the seeded config and tests
+... [100%]
+3 passed in 0.00s
+GATE PASS (.../run-output/gate-20261014T092431Z-4eL32J)
+```
+
+OpenCode took 9 steps and 6 tool calls (`bash`, `bash`, `read`, `read`,
+`edit`, `bash`), 21 seconds from its first event to its last, with at most
+11,355 input tokens on a step. Its one edit to `invoice_totals/amounts.py`:
+
+```diff
+ cleaned = text.strip().replace("$", "").replace(",", "")
++ if cleaned.startswith("(") and cleaned.endswith(")"):
++ cleaned = "-" + cleaned[1:-1].strip()
+ return Decimal(cleaned)
```
### BFCL through SIE Relay
-The planned measurement of `zai-org/GLM-5.3-Flash:relay` on the Berkeley
+The measurement of `zai-org/GLM-5.3-Flash:relay` on the Berkeley
Function Calling Leaderboard, BFCL v3, from
`gorilla-llm/Berkeley-Function-Calling-Leaderboard`: the full `simple` split
and a 200-row subsample of `multiple`, each answer scored by AST match against
BFCL's accepted calls, sent through SIE Cloud with the tools declared on the
request.
-| Task | Rows | AST accuracy |
-|---|---|---|
-| `simple` | 400 | pending |
-| `multiple` | 200 | pending |
+| Task | Rows | Correct | AST accuracy |
+|---|---|---|---|
+| `simple` | 400 | 368 | 0.920 |
+| `multiple` | 200 | 184 | 0.920 |
+
+Recorded 2026-10-14 on the same SIE Cloud endpoint, one request at a time
+with an output cap of 8,192 tokens and `tool_choice: "auto"`.
-The numbers are filled in with the run date once the measurement is
-recorded.
+- BFCL names many functions with dots, such as `math.factorial`.
+ OpenAI-compatible APIs accept only letters, digits, `_` and `-` in a
+ function name, and SIE Relay refuses the dotted form. So each dotted name
+ was sent with `_` in place of the dot, and the model's calls were mapped
+ back to BFCL's names before scoring, as BFCL's own harness does for
+ OpenAI-style function calling.
+- One of the 600 requests failed with a `502` and is scored as a miss.
## Checked without a GPU
@@ -364,14 +423,19 @@ That is a check of the checker. The endpoint itself is only checked by running
- **Not a coding benchmark.** The seeded fixture is two failing tests in a
twenty-line module. Passing it shows that the loop closes, tools run and
files land; it says nothing about harder tasks.
-- **Not a tool-calling score.** The conformance cases use one weather tool.
- BFCL above is the measurement, and its numbers are pending.
+- **Not a full BFCL score.** The conformance cases use one weather tool. The
+ BFCL figures above cover the `simple` split and a 200-row `multiple`
+ subsample, scored by AST match. BFCL's executable, parallel, relevance and
+ multi-turn categories were not run.
- **Not a claim about every OpenCode version.** The wire facts were recorded
with OpenCode 1.19.0. A later version can change what it sends; the
recording stub approach in this README is how to re-check.
- **Not a claim about every laptop.** The laptop recipe was run on one Apple
Silicon machine with one 4B model. NVIDIA and other models have not been
run.
-- **Not a Cloud result yet.** The Cloud table, the served-by header, the gate
- run, the terminal recording, the usage rows and the BFCL figures are
- placeholders until the run on the deployed endpoint is recorded here.
+- **Not a measurement of SIE's own GPU serving.** Through SIE Relay the
+ model runs on a partner's servers. SIE routes the request, checks the wire
+ and meters it. A dedicated GPU deployment of the same model is a different
+ serving path and has its own window and limits.
+- **One endpoint, one day.** The Cloud results were recorded once, on
+ 2026-10-14.