Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ the [documentation](https://oracle-samples.github.io/locus/).
| **[📊 Evaluation](https://oracle-samples.github.io/locus/concepts/evaluation/)** | `EvalCase` / `EvalRunner` / `EvalReport` — regression suites, custom evaluators, pass / score / duration reporting. |
| **[🛂 Termination algebra](https://oracle-samples.github.io/locus/concepts/termination/)** | Eight composable stop conditions on `Agent(termination=…)`: `MaxIterations \| TextMention("DONE") & ConfidenceMet(0.9)` is real Python (`__or__` / `__and__` overloads). |
| **[🧰 Models](https://oracle-samples.github.io/locus/concepts/models/)** | OCI GenAI native (V1 + SDK transport, 90+ models, day-0) · OpenAI · Anthropic · Ollama. One auth surface for OCI: profile, session token, instance / resource principal. |
| **[🏗 OCI Dedicated AI Cluster](https://oracle-samples.github.io/locus/how-to/oci-dac/)** | Pass an `ocid1.generativeaiendpoint.<region>....` OCID and locus auto-routes to `DedicatedServingMode` with real SSE streaming. Live-tested against Qwen on a London DAC. |

## The agent loop

Expand Down Expand Up @@ -206,7 +207,7 @@ print(agent.run_sync(

## Tutorials

[`examples/`](examples/) has 39 progressive tutorials, each a single
[`examples/`](examples/) has 40 progressive tutorials, each a single
runnable file. The full set runs end-to-end in CI on every commit;
each tutorial is a working program against a real model.

Expand All @@ -218,6 +219,7 @@ each tutorial is a working program against a real model.
| **Multi-agent** | [`11_swarm_multiagent`](examples/tutorial_11_swarm_multiagent.py) · [`16_agent_handoff`](examples/tutorial_16_agent_handoff.py) · [`17_orchestrator_pattern`](examples/tutorial_17_orchestrator_pattern.py) · [`34_a2a_protocol`](examples/tutorial_34_a2a_protocol.py) |
| **RAG** | [`22_rag_basics`](examples/tutorial_22_rag_basics.py) · [`24_rag_agents`](examples/tutorial_24_rag_agents.py) |
| **Production** | [`19_guardrails_security`](examples/tutorial_19_guardrails_security.py) · [`20_checkpoint_backends`](examples/tutorial_20_checkpoint_backends.py) · [`28_agent_server`](examples/tutorial_28_agent_server.py) · [`37_termination`](examples/tutorial_37_termination.py) |
| **OCI** | [`29_model_providers`](examples/tutorial_29_model_providers.py) · [`40_oci_dac`](examples/tutorial_40_oci_dac.py) — Dedicated AI Cluster endpoints |

End-to-end demos:

Expand Down
42 changes: 42 additions & 0 deletions docs/how-to/oci-dac.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,48 @@ get_model("oci:ocid1.generativeaiendpoint....")
→ SDK chat() routes to your DAC.
```

## Confirmed working — Qwen on a London DAC

Live-tested against a `uk-london-1` DAC endpoint running Qwen
(Alibaba Cloud) on 2026-05-01. End-to-end results from the live run
(see [`examples/tutorial_40_oci_dac.py`](https://github.com/oracle-samples/locus/blob/main/examples/tutorial_40_oci_dac.py)):

```text
=== Part 3: complete() against the DAC ===
Reply: 'I am a large-scale language model developed by Alibaba Cloud, known as Qwen.'
usage: {'prompt_tokens': 17, 'completion_tokens': 18}
stop_reason: stop

=== Part 4: stream() against the DAC ===
Streaming reply (chunks shown inline):
1, 2, 3, 4, 5
```

What's proven by the run:

- **Routing** — `oci:ocid1.generativeaiendpoint....` resolved to
`OCIModel`, not `OCIOpenAIModel`.
- **Serving mode** — `DedicatedServingMode(endpoint_id=...)` was
accepted by the live endpoint.
- **Real SSE** — chunks arrived as character-by-character deltas, not
the fallback path.
- **Token accounting** — `usage` populated correctly (17 / 18 tokens).

What's still model-specific (Qwen on this DAC, with the deployment as
provisioned by Luigi's tenancy):

- Tool calls come back as `<tool_call>{...}</tool_call>` text blocks
inside `message.content`, not as structured `tool_calls` array
entries. Locus's `GenericProvider.parse_response()` doesn't extract
them as `ToolCall`s. Two ways to fix:
1. **Deploy-side**: configure the DAC with a Qwen3-family flag like
`--enable-auto-tool-choice` so the model emits OpenAI-style
`tool_calls`. Locus picks them up automatically.
2. **Caller-side**: post-process `result.message` for
`<tool_call>{...}</tool_call>` blocks and re-issue them via
`agent.run_sync(...)` with the parsed call. A small regex
extraction; not built into locus today.

## Streaming

`OCIModel.stream()` flips `is_stream=True` on the underlying
Expand Down
8 changes: 5 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ them in one process; stream events from any of them in the same
| **📊 Evaluation** | `EvalCase` / `EvalRunner` / `EvalReport` regression suites. |
| **🛂 Termination algebra** | Eight composable stop conditions. `Or` and `And` compose them. |
| **🧰 Models** | OCI GenAI native (V1 + SDK) · OpenAI · Anthropic · Ollama. |
| **🏗 OCI Dedicated AI Cluster** | Pass an `ocid1.generativeaiendpoint....` OCID, get `DedicatedServingMode` with real SSE streaming. Live-tested on Qwen / London. |

## Hello, agent

Expand Down Expand Up @@ -350,7 +351,7 @@ Read the [concepts](concepts/agent.md) for the *why*; read the
## Learn locus in an afternoon

The [`examples/`](https://github.com/oracle-samples/locus/tree/main/examples)
tree is **39 tutorials** plus **3 end-to-end demos**. Every tutorial
tree is **40 tutorials** plus **3 end-to-end demos**. Every tutorial
is one runnable file and adds exactly one idea on top of the previous.

### Track 1 — basics (first hour)
Expand Down Expand Up @@ -394,7 +395,7 @@ The six in-process patterns plus A2A:
[RAG agents](https://github.com/oracle-samples/locus/blob/main/examples/tutorial_24_rag_agents.py) ·
[Skills](https://github.com/oracle-samples/locus/blob/main/examples/tutorial_32_skills.py).

### Track 5 — production (12, 19–21, 26–30, 33, 35, 37–39)
### Track 5 — production (12, 19–21, 26–30, 33, 35, 37–40)

[MCP](https://github.com/oracle-samples/locus/blob/main/examples/tutorial_12_mcp_integration.py) ·
[Guardrails](https://github.com/oracle-samples/locus/blob/main/examples/tutorial_19_guardrails_security.py) ·
Expand All @@ -410,7 +411,8 @@ The six in-process patterns plus A2A:
[Graph advanced](https://github.com/oracle-samples/locus/blob/main/examples/tutorial_35_graph_advanced.py) ·
[Termination](https://github.com/oracle-samples/locus/blob/main/examples/tutorial_37_termination.py) ·
[Multi-modal providers](https://github.com/oracle-samples/locus/blob/main/examples/tutorial_38_multimodal_providers.py) ·
[GSAR typed grounding](https://github.com/oracle-samples/locus/blob/main/examples/tutorial_39_gsar_typed_grounding.py).
[GSAR typed grounding](https://github.com/oracle-samples/locus/blob/main/examples/tutorial_39_gsar_typed_grounding.py) ·
[OCI Dedicated AI Cluster (DAC)](https://github.com/oracle-samples/locus/blob/main/examples/tutorial_40_oci_dac.py).

### End-to-end demos

Expand Down
Loading
Loading