wave-dispatch 0.6.3 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/wave_dispatch.rb +12 -5
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 15ed7daba83d3a9801bd114822429c0acaa39bb079c25fd6d4dc24f818bfac38
4
- data.tar.gz: 28f96397843264fba48cb1db379137be182277bd53ef305578a8b83022dc3a7d
3
+ metadata.gz: e05474910e47de3ed80e1ccb7c6754376fd7971155d01ac84cbb38ea0aa9a7d8
4
+ data.tar.gz: 14963fba66db8931857214beb9cf33d53aa3cc02dd66993c0c37255c131e523d
5
5
  SHA512:
6
- metadata.gz: d9791cbd667001bb708783d4de3b7e675d176802e6b475a5dab37a8ada91ab3e066b4e7848c494721c601fa8d63cee2e585dfb7cfb2f409b29c3b6c75559fe3c
7
- data.tar.gz: a21f6576804c38cdc4c0844226e2e326613571cd6d5ca649e6a5e3ec6dacaff418c8ff84aa2806521cf607af532e987d3b7eed7446ac5fbfecf0cc340ae7c13f
6
+ metadata.gz: 4e6cbdfb694d6c96995bfe0b841a2c050b6c1d683e93d957f75486081a5221b9c82467b1ea9285d4d3274523fc9aabd867badf723284ca3d377ffc37e3f6137a
7
+ data.tar.gz: 2517d269332cd8fbda750de3bec34a0b46f049107534a97c9da49789c1b403ff16e838bcb7b3a0781ec9228a315043e4d90fd63c7b90e62e4585fca7a323a221
data/lib/wave_dispatch.rb CHANGED
@@ -7,7 +7,7 @@ require "uri"
7
7
  require "openssl"
8
8
 
9
9
  module WaveDispatch
10
- VERSION = "0.6.3"
10
+ VERSION = "0.7.0"
11
11
 
12
12
  # 0.5.1 — payment hook: a Proc called once with the 402 challenge body (Hash) that returns the
13
13
  # headers (Hash[String => String]) to retry the request with. Pair with `Client.wallet_hook(provider:,
@@ -23,13 +23,14 @@ module WaveDispatch
23
23
  end
24
24
 
25
25
  # Classify a prompt (no execution) -> {"route", "probability", "margin", "forward"}
26
- def route(prompt) = send_req(:post, @endpoint + "/", { prompt: prompt })
26
+ # Sovereign tier: pass profile (Fast|Expert|Heavy|Code) to request a named routing profile.
27
+ def route(prompt, profile = nil) = send_req(:post, @endpoint + "/", with_profile({ prompt: prompt }, profile))
27
28
 
28
- # Classify and run on the edge if your plan allows it.
29
- def execute(prompt) = send_req(:post, @endpoint + "/", { prompt: prompt, execute: true })
29
+ # Classify and run on the edge if your plan allows it. Optional profile as in route.
30
+ def execute(prompt, profile = nil) = send_req(:post, @endpoint + "/", with_profile({ prompt: prompt, execute: true }, profile))
30
31
 
31
32
  # Classify a pre-computed 768-d embedding (matmul-only: cheapest + fastest).
32
- def route_vector(vector) = send_req(:post, @endpoint + "/", { vector: vector })
33
+ def route_vector(vector, profile = nil) = send_req(:post, @endpoint + "/", with_profile({ vector: vector }, profile))
33
34
 
34
35
  # This license's savings ledger (decisions, saved_usd, saved_pct, ...). Requires a license.
35
36
  def savings = send_req(:get, "#{@agents}/ledger/summary?license=#{lic}")
@@ -53,6 +54,12 @@ module WaveDispatch
53
54
 
54
55
  private
55
56
 
57
+ # Sovereign tier (D3): attach a named routing profile to the request body. snake_case `profile` is
58
+ # the cross-SDK contract; the edge resolveProfile() honors body.profile over per-license KV + defaults.
59
+ def with_profile(body, profile)
60
+ profile ? body.merge(profile: profile) : body
61
+ end
62
+
56
63
  def lic
57
64
  raise "dispatch: a license is required for savings/subscription" unless @license
58
65
  URI.encode_www_form_component(@license)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wave-dispatch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.3
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - WAVE Online, LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-05-29 00:00:00.000000000 Z
11
+ date: 2026-05-30 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Route each request to the cheapest capable model (local-first; escalate
14
14
  to your frontier only when needed). BYO keys + infra.