interplane.Get Omega
Read in your language

omega-tool-model

First-party Omega tool-use model source, serving harnesses, and verification records

Brought by drakestapleton

branch main Branches Tags History

omega-tool-model / deployment / conversation / chat.om

323 lines · 6565 bytes Raw Blame History
1note Bounded chat-only bridge to the separately approved local Qwen companion.
2note No URLs, files, tool permissions or generation settings are taken from model text.
3global cbuf uchar 131072
4global clen ulong 1
5global caddr uchar 16
6global cfd int 1
7global cp ulong 1
8global cend ulong 1
9global ccount ulong 1
10global csent ulong 1
11text csys "You are a helpful conversational assistant running locally on Drake's Spark, powered by Qwen3-30B-A3B-Instruct-2507. You are a separate companion to his custom-trained Omega round40 model, not that small model and not ChatGPT. Speak in clear, natural, plain English. Drake is an engineer learning programming, so explain necessary technical terms and avoid jargon dumps. Follow the conversation, use facts the user provides, and accept corrections. Ask a short clarifying question when a request is unclear. Do not invent facts, memories, credentials, tool actions, measurements, or claims of success. You can discuss many subjects, but cannot browse, access past chat archives, modify weights or run tools from this chat. The separate Practice with tools section on this page uses Drake's round40 model to read, repair and test small temporary Omega arithmetic files. Those tools are not connected to you. When asked for current information, say when you cannot verify it. Omega code uses prefix operations and structured fn/ret/end, for example: fn main to int, ret add int 2 int 3, end, with one statement per line. Be honest when you do not know the correct Omega syntax. Conversation messages supplied here are your available personal context. Keep replies concise unless more detail is requested."
12text cpre "{\"model\":\"omega-chat-companion\",\"stream\":true,\"cache_prompt\":true,\"max_tokens\":1024,\"temperature\":0.6,\"top_p\":0.8,\"messages\":[{\"role\":\"system\",\"content\":\""
13text cuser ",{\"role\":\"user\",\"content\":\""
14text cassist ",{\"role\":\"assistant\",\"content\":\""
15text creq "POST /v1/chat/completions HTTP/1.1\nHost: 127.0.0.1:18178\nContent-Type: application/json\nConnection: close\nContent-Length: "
16text cunavail "HTTP/1.1 503 Service Unavailable\nConnection: close\nContent-Type: text/plain; charset=utf-8\nCache-Control: no-store\n\nThe conversational model is unavailable. Your message has been kept; try again shortly."
17text cbad "HTTP/1.1 400 Bad Request\nConnection: close\nContent-Type: text/plain; charset=utf-8\nCache-Control: no-store\n\nThis conversation is too large or malformed. Start a new chat or shorten the message."
18
19fn cb c uchar to void
20if ge get clen 0 131072
21exit 90
22end
23put cbuf get clen 0 c
24put clen 0 add get clen 0 1
25end
26fn cjson c uchar to void
27if or eq c 34 eq c 92
28cb 92
29cb c
30ret
31end
32if eq c 10
33cb 92
34cb 110
35ret
36end
37if eq c 13
38cb 92
39cb 114
40ret
41end
42if eq c 9
43cb 92
44cb 116
45ret
46end
47cb c
48end
49fn cbody to bool
50n = get hsize 0
51off = get hend 0
52if or eq n 0 gt n 24000
53ret false
54end
55total = add off n
56if gt get hcount 0 total
57ret false
58end
59deadline = add monons long 5000000000
60while lt get hcount 0 total bound 24000
61p = get hcount 0
62left = sub deadline monons
63if le left 0
64ret false
65end
66if le waitio get hfd 0 1 left 0
67ret false
68end
69r = recv get hfd 0 hreq p sub total p 64
70if eq r neg long 11
71continue
72end
73if le r 0
74ret false
75end
76put hcount 0 add p ulong r
77end
78put cp 0 off
79put cend 0 total
80ret true
81end
82fn cmessage to bool
83p = get cp 0
84endp = get cend 0
85if ge p endp
86ret false
87end
88want = uchar 85
89if eq rem get ccount 0 2 1
90want = 65
91end
92if ne get hreq p want
93ret false
94end
95p = add p 1
96n = ulong 0
97digits = ulong 0
98while lt p endp bound 8
99c = get hreq p
100if eq c 10
101break
102end
103if or lt c 48 gt c 57
104ret false
105end
106digits = add digits 1
107n = add mul n 10 ulong sub c 48
108if or gt n 8000 gt digits 4
109ret false
110end
111p = add p 1
112end
113if or eq digits 0 eq n 0
114ret false
115end
116if ge p endp
117ret false
118end
119if ne get hreq p 10
120ret false
121end
122p = add p 1
123if gt add p n endp
124ret false
125end
126if eq want 85
127for i ulong len cuser
128cb get cuser i
129end
130else
131for i ulong len cassist
132cb get cassist i
133end
134end
135if not ccontent p n
136ret false
137end
138cb 34
139cb 125
140put cp 0 add p n
141put ccount 0 add get ccount 0 1
142ret true
143end
144fn ccontent p ulong n ulong to bool
145for i ulong n
146c = get hreq add p i
147if lt c 32
148if not or eq c 10 or eq c 13 eq c 9
149ret false
150end
151end
152cjson c
153end
154ret true
155end
156fn cbuild to bool
157put clen 0 0
158put ccount 0 0
159for i ulong len cpre
160cb get cpre i
161end
162for i ulong len csys
163cjson get csys i
164end
165cb 34
166cb 125
167while lt get cp 0 get cend 0 bound 63
168if not cmessage
169ret false
170end
171if ge get ccount 0 63
172if lt get cp 0 get cend 0
173ret false
174end
175end
176end
177if eq rem get ccount 0 2 0
178ret false
179end
180cb 93
181cb 125
182ret true
183end
184fn cnumber n ulong to void
185if ge n 10
186cnumber div n 10
187end
188put hbuf get wused 0 uchar add rem n 10 48
189put wused 0 add get wused 0 1
190end
191fn cheader to bool
192put wused 0 0
193for i ulong len creq
194c = get creq i
195if eq c 10
196put hbuf get wused 0 13
197put wused 0 add get wused 0 1
198end
199put hbuf get wused 0 c
200put wused 0 add get wused 0 1
201end
202cnumber get clen 0
203put hbuf get wused 0 13
204put hbuf add get wused 0 1 10
205put hbuf add get wused 0 2 13
206put hbuf add get wused 0 3 10
207old = get hfd 0
208put hfd 0 get cfd 0
209ok = hsend add get wused 0 4
210put hfd 0 old
211ret ok
212end
213fn csend to bool
214p = ulong 0
215deadline = add monons long 5000000000
216while lt p get clen 0 bound 131072
217left = sub deadline monons
218if le left 0
219ret false
220end
221if le waitio get cfd 0 4 left 0
222ret false
223end
224r = send get cfd 0 cbuf p sub get clen 0 p 64
225if eq r neg long 11
226continue
227end
228if le r 0
229ret false
230end
231p = add p ulong r
232end
233ret true
234end
235fn cunavailable to void
236p = ulong 0
237for i ulong len cunavail
238c = get cunavail i
239if eq c 10
240put hbuf p 13
241p = add p 1
242end
243put hbuf p c
244p = add p 1
245end
246r = hsend p
247end
248fn cinvalid to void
249p = ulong 0
250for i ulong len cbad
251c = get cbad i
252if eq c 10
253put hbuf p 13
254p = add p 1
255end
256put hbuf p c
257p = add p 1
258end
259r = hsend p
260end
261fn cproxy to void
262deadline = add monons long 120000000000
263put csent 0 0
264for chunk ulong 65536
265left = sub deadline monons
266if le left 0
267break
268end
269if le waitio get cfd 0 1 left 0
270break
271end
272n = recv get cfd 0 hbuf 0 65536 64
273if eq n neg long 11
274continue
275end
276if le n 0
277break
278end
279put csent 0 1
280if not hsend ulong n
281ret
282end
283end
284if eq get csent 0 0
285cunavailable
286end
287end
288fn cchat to void
289if not cbody
290cinvalid
291ret
292end
293if not cbuild
294cinvalid
295ret
296end
297put caddr 0 2
298put caddr 2 71
299put caddr 3 2
300put caddr 4 127
301put caddr 7 1
302fd = socknew 2 524289 0
303if lt fd 0
304cunavailable
305ret
306end
307if ne connect int fd caddr 0 16 0
308r = fclose int fd
309cunavailable
310ret
311end
312put cfd 0 int fd
313if cheader
314if csend
315cproxy
316else
317cunavailable
318end
319else
320cunavailable
321end
322r = fclose int fd
323end