Skip to content

fix: Update image tag for nemotron-3-nano - #67

Closed
necr0n wants to merge 1 commit into
NVIDIA:mainfrom
necr0n:patch-1
Closed

necr0n wants to merge 1 commit into
NVIDIA:mainfrom
necr0n:patch-1

Conversation

@necr0n

@necr0n necr0n commented Mar 17, 2026

Copy link
Copy Markdown

@necr0n

necr0n commented Mar 17, 2026

Copy link
Copy Markdown
Author
Choose model [1]: 1
  Pulling NIM image for nvidia/nemotron-3-nano-30b-a3b...
  Pulling NIM image: nvcr.io/nim/nvidia/nemotron-3-nano:latest
latest: Pulling from nim/nvidia/nemotron-3-nano
Digest: sha256:e3e0d68b552d8a1298704c46ac204d67d06371859624fe86524c059a0221ce65
Status: Image is up to date for nvcr.io/nim/nvidia/nemotron-3-nano:latest
nvcr.io/nim/nvidia/nemotron-3-nano:latest
  Starting NIM container...

@necr0n necr0n changed the title Update image tag for nemotron-3-nano fix: Update image tag for nemotron-3-nano Mar 17, 2026
@necr0n
necr0n marked this pull request as ready for review March 17, 2026 00:37
deepujain added a commit to deepujain/NemoClaw that referenced this pull request Mar 17, 2026
deepujain added a commit to deepujain/NemoClaw that referenced this pull request Mar 20, 2026
@wscurran wscurran added the bug label Mar 20, 2026
@wscurran

Copy link
Copy Markdown
Contributor

Thanks for updating the image tag for nemotron-3-nano to match the latest version, this ensures users have access to the most current images.

@cv

cv commented Mar 21, 2026

Copy link
Copy Markdown
Collaborator

Hi @necr0n! Thanks for catching the image tag issue for nemotron-3-nano. Quick request — the repo has picked up a lot of changes since this was filed (CI, new features, and more). Could you rebase onto the current main so we can review it with a clean diff? Should be straightforward for a change like this. Thanks again!

deepujain added a commit to deepujain/NemoClaw that referenced this pull request Mar 24, 2026
mafueee pushed a commit to mafueee/NemoClaw that referenced this pull request Mar 28, 2026
Closes NVIDIA#67

## Summary

Implements transparent inference interception and routing for sandboxed AI agents. The sandbox proxy intercepts outbound AI SDK calls (OpenAI, Anthropic) and reroutes them through the gateway to policy-controlled backends — enabling organizations to redirect inference traffic to local or self-hosted models without modifying agent code.

**Decision model** — a tri-state OPA evaluation for every CONNECT request:
1. Binary + endpoint explicitly allowed in `network_policies` → **allow** (pass through)
2. Not explicitly allowed + `inference.allowed_routes` configured → **inspect for inference** (TLS intercept, detect API patterns, route through gateway)
3. Otherwise → **deny**

No endpoint declarations or binary lists needed for inference routing. Just configure `inference.allowed_routes`.

## Key Changes

### Sandbox (interception)
- **OPA policy**: New `network_action` Rego rule with three outcomes (`allow`, `inspect_for_inference`, `deny`). New `NetworkAction` enum replaces `PolicyDecision.allowed` bool for the proxy's main decision path.
- **Proxy**: New `InspectForInference` path — TLS-terminates client, parses HTTP, detects inference API patterns (`POST /v1/chat/completions`, `/v1/completions`, `/v1/messages`), strips auth headers, forwards via gRPC.
- **New module**: `l7/inference.rs` — `InferenceApiPattern`, `detect_inference_pattern()`, HTTP request/response parsing.
- **gRPC client**: New `proxy_inference()` for sandbox→gateway forwarding.
- **Sandbox init**: Creates OPA engine when inference is configured, even without `network_policies`.

### Gateway (dispatch)
- **InferenceService**: `ProxyInference` RPC loads sandbox policy, resolves allowed routes, dispatches to router. Full CRUD for inference routes.
- **Proto**: `InferenceRoute`, `InferenceRouteSpec`, `ProxyInferenceRequest/Response`, Inference gRPC service.

### Router (backend proxying)
- **New crate**: `navigator-router` with `Router`, `proxy_with_candidates()`, protocol-based route selection, backend HTTP proxying with auth header rewriting.
- **Mock support** for testing (`mock://` scheme).

### CLI
- `nav inference create/update/delete/list` commands for route management.

### Python SDK
- Updated protobuf bindings. Removed old `inference.py` client (replaced by transparent interception).

### Documentation
- New `architecture/inference-routing.md` — end-to-end system documentation.
- Updated `architecture/sandbox.md` — proxy, OPA, and source index sections.
- Updated `architecture/README.md` — new subsystem overview and diagram.

## Addendum: Chunked Transfer Compatibility

This branch now also fixes intercepted SDK requests that send chunked request bodies:

- `inspect_for_inference` now accepts `Transfer-Encoding: chunked` and decodes chunked request bodies before forwarding to the gateway
- Removed the prior `411 Length Required` response for chunked intercepted requests
- Added request/response header sanitization for framing and hop-by-hop headers (`content-length`, `transfer-encoding`, `connection`, etc.) to keep forwarded requests and returned responses valid
- Added unit tests for chunked parsing and header sanitization

Note: this improves compatibility for streaming-style SDK request patterns; true token-by-token passthrough response streaming is still a separate follow-up.

## Minimal Policy for Inference Routing

```yaml
inference:
  allowed_routes:
    - local
```

Any outgoing connection from a binary not explicitly allowed in `network_policies` will be intercepted and checked for inference API patterns.

## Test Plan

- [x] `cargo test --workspace` — all tests pass
- [x] `mise run pre-commit` — all checks pass
- [x] E2E: OpenAI chat completions routed through gateway
- [x] E2E: Anthropic messages routed through gateway
- [x] E2E: Python OpenAI SDK from sandbox (`examples/inference/inference.py`)
- [x] E2E test: `e2e/python/test_inference_routing.py`
mafueee pushed a commit to mafueee/NemoClaw that referenced this pull request Mar 28, 2026
@necr0n

necr0n commented Mar 30, 2026

Copy link
Copy Markdown
Author

fixed in #81

@necr0n necr0n closed this Mar 30, 2026
@necr0n
necr0n deleted the patch-1 branch March 30, 2026 11:13
@wscurran wscurran added bug-fix PR fixes a bug or regression and removed bug labels Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug-fix PR fixes a bug or regression

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants