interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / tools / pi-drive-27b / pi_drive.om

173 lines · 3341 bytes Raw Blame History
1note pi_drive.om -- pure seeded Omega (OM-2) client running on Raspberry Pi (AArch64)
2note to drive Qwen3.8-27B-FP8 on DGX Spark GB10 GPU over WireGuard (100.64.0.2:18099).
3note Build natively on Pi (AArch64 Linux) with zero C / Python / curl:
4note { printf 'om2\n'; cat seed/net/http.om tools/pi-drive-27b/pi_drive.om; } | ./seed/out/omc > pi_drive
5note Usage on Pi:
6note ./pi_drive (sends built-in Omega codegen prompt)
7note ./pi_drive < request.json (sends custom /v1/chat/completions JSON body)
8
9const PDIP ulong 2130706433
10const PDPORT ulong 18099
11const PDTMO long 600000000000
12const PDMAXREQ ulong 524288
13const PDMAXRSP ulong 65536
14
15text pdget "GET"
16text pdpost "POST"
17text pdhost "Host"
18text pdhostv "127.0.0.1:18099"
19text pdctype "Content-Type"
20text pdjson "application/json"
21text pdphealth "/health"
22text pdpchat "/v1/chat/completions"
23text pdnl "\n"
24text pddflt "{\"model\":\"qwen3.8-27b-fp8\",\"max_tokens\":128,\"temperature\":0,\"messages\":[{\"role\":\"user\",\"content\":\"Write a 6-line pure Omega (OM-1) function fn sq x ulong to ulong that returns x*x, with no markdown.\"}]}"
25
26fn pddial cs edit ulong 320 io edit uchar 65536 to long
27a = new uchar 16 0
28r = haddr4 a uint PDIP PDPORT
29if lt r 0
30ret r
31end
32fd = hdial a PDTMO
33if lt fd 0
34ret fd
35end
36r = hinit cs io int fd 0
37if lt r 0
38c = fclose int fd
39ret r
40end
41hsettmo cs PDTMO PDTMO
42hsetbdl cs PDTMO
43ret 0
44end
45
46fn pdreadin buf edit uchar 524288 to ulong
47n = ulong 0
48done = ulong 0
49while and lt n PDMAXREQ eq done 0 bound 524288
50r = read 0 buf n sub PDMAXREQ n
51if le r 0
52done = 1
53else
54n = add n ulong r
55end
56end
57ret n
58end
59
60fn pdwriteall fd int buf view uchar * n ulong to long
61off = ulong 0
62while lt off n bound 65536
63r = write fd buf off sub n off
64if le r 0
65ret -1
66end
67off = add off ulong r
68end
69ret 0
70end
71
72fn pdhealth to long
73cs = new ulong 320 0
74io = new uchar 65536 0
75rsp = new uchar 4096 0
76r = pddial cs io
77if lt r 0
78ret r
79end
80r = hreqst cs io pdget
81r = hfe r hreqtg cs io pdphealth
82r = hfe r hhname cs io pdhost
83r = hfe r hhval cs io pdhostv
84r = hfe r hhend cs io 0 0
85r = hfe r hwfin cs io
86if lt r 0
87c = hclose cs
88ret r
89end
90st = hrsprd cs io
91if ne st 200
92c = hclose cs
93if lt st 0
94ret st
95end
96ret sub 0 st
97end
98put cs 10 4096
99n = hbodyall cs io rsp
100c = hclose cs
101if lt n 0
102ret n
103end
104w = pdwriteall 2 rsp ulong n
105w = write 2 pdnl 0 len pdnl
106ret 0
107end
108
109fn pdchat req view uchar * rlen ulong to long
110cs = new ulong 320 0
111io = new uchar 65536 0
112rsp = new uchar 65536 0
113r = pddial cs io
114if lt r 0
115ret r
116end
117r = hreqst cs io pdpost
118r = hfe r hreqtg cs io pdpchat
119r = hfe r hhname cs io pdhost
120r = hfe r hhval cs io pdhostv
121r = hfe r hhname cs io pdctype
122r = hfe r hhval cs io pdjson
123r = hfe r hhend cs io 0 rlen
124i = ulong 0
125while and ge r 0 lt i rlen bound 524288
126r = hputb cs io get req i
127i = add i 1
128end
129r = hfe r hwfin cs io
130if lt r 0
131c = hclose cs
132ret r
133end
134st = hrsprd cs io
135if ne st 200
136c = hclose cs
137if lt st 0
138ret st
139end
140ret sub 0 st
141end
142put cs 10 PDMAXRSP
143n = hbodyall cs io rsp
144c = hclose cs
145if lt n 0
146ret n
147end
148w = pdwriteall 1 rsp ulong n
149w = write 1 pdnl 0 len pdnl
150ret 0
151end
152
153fn main to long
154r = pdhealth
155if lt r 0
156ret 1
157end
158req = new uchar 524288 0
159n = pdreadin req
160if eq n 0
161i = ulong 0
162while lt i len pddflt bound 4096
163put req i get pddflt i
164i = add i 1
165end
166n = len pddflt
167end
168r = pdchat req n
169if lt r 0
170ret 2
171end
172ret 0
173end