wave-dispatch 0.1.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.
- checksums.yaml +7 -0
- data/lib/wave_dispatch.rb +34 -0
- metadata +45 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: e4c775b53e4a96fcf951036dd860ad9d7caf2e2cdd86c0812921ff2e6f5b2fbb
|
|
4
|
+
data.tar.gz: f6cc786bd777807eeccda5f3a79a92dbfa63074ea2f209f5417dd201b4b2c29b
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 3199c890be6fe2d2026e76932a8cfe9f4c137c4fcea1caf2e686fcbcf1604f4b7a36a9174a8c20c61e1d68f4f563c64d12b7e0ba5ef15c1433b19a30aa20bc84
|
|
7
|
+
data.tar.gz: f5403ff2b3c04d5e45e091d7e3285e5ea0f54224cfa97dd379f0e1a1b356714d71d8a960c5c9cb98ef6d82c3159e551bc1c49854eb2dd6d02cdce1c69bd461e5
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# wave Dispatch — thin Ruby client. Route each request to the cheapest capable model (local-first;
|
|
2
|
+
# escalate to your frontier only when needed). BYO keys + infra. Stdlib only (net/http).
|
|
3
|
+
require "net/http"
|
|
4
|
+
require "json"
|
|
5
|
+
require "uri"
|
|
6
|
+
|
|
7
|
+
module WaveDispatch
|
|
8
|
+
VERSION = "0.1.0"
|
|
9
|
+
|
|
10
|
+
class Client
|
|
11
|
+
def initialize(license = ENV["WAVE_LICENSE"], endpoint: "https://dispatch.wave.online")
|
|
12
|
+
@license = license
|
|
13
|
+
@endpoint = endpoint
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# Classify a prompt (no execution) -> {"route", "probability", "margin", "forward"}
|
|
17
|
+
def route(prompt) = post({ prompt: prompt })
|
|
18
|
+
|
|
19
|
+
# Classify and run on the edge if your plan allows it.
|
|
20
|
+
def execute(prompt) = post({ prompt: prompt, execute: true })
|
|
21
|
+
|
|
22
|
+
private
|
|
23
|
+
|
|
24
|
+
def post(body)
|
|
25
|
+
uri = URI(@endpoint + "/")
|
|
26
|
+
req = Net::HTTP::Post.new(uri, "content-type" => "application/json")
|
|
27
|
+
req["authorization"] = "Bearer #{@license}" if @license
|
|
28
|
+
req.body = body.to_json
|
|
29
|
+
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |h| h.request(req) }
|
|
30
|
+
raise "dispatch: 402 payment required (x402)" if res.code == "402"
|
|
31
|
+
JSON.parse(res.body)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: wave-dispatch
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- WAVE Online, LLC
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2026-05-26 00:00:00.000000000 Z
|
|
12
|
+
dependencies: []
|
|
13
|
+
description: Route each request to the cheapest capable model (local-first; escalate
|
|
14
|
+
to your frontier only when needed). BYO keys + infra.
|
|
15
|
+
email:
|
|
16
|
+
executables: []
|
|
17
|
+
extensions: []
|
|
18
|
+
extra_rdoc_files: []
|
|
19
|
+
files:
|
|
20
|
+
- lib/wave_dispatch.rb
|
|
21
|
+
homepage: https://dispatch.wave.online
|
|
22
|
+
licenses:
|
|
23
|
+
- MIT
|
|
24
|
+
metadata:
|
|
25
|
+
source_code_uri: https://github.com/wave-av/dispatch-edge
|
|
26
|
+
post_install_message:
|
|
27
|
+
rdoc_options: []
|
|
28
|
+
require_paths:
|
|
29
|
+
- lib
|
|
30
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
31
|
+
requirements:
|
|
32
|
+
- - ">="
|
|
33
|
+
- !ruby/object:Gem::Version
|
|
34
|
+
version: '2.7'
|
|
35
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
36
|
+
requirements:
|
|
37
|
+
- - ">="
|
|
38
|
+
- !ruby/object:Gem::Version
|
|
39
|
+
version: '0'
|
|
40
|
+
requirements: []
|
|
41
|
+
rubygems_version: 3.0.3.1
|
|
42
|
+
signing_key:
|
|
43
|
+
specification_version: 4
|
|
44
|
+
summary: wave Dispatch — local-first AI router client
|
|
45
|
+
test_files: []
|