A local-first private AI assistant for everyday use. Runs on-device models with encrypted P2P sync, and supports sharing chats publicly on ATProto.
10
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: CLI changes for running mem-agent model

- Native interactive interface if model is mem-agent family
- Communication between the py server for load model and chat

madclaws 2e17f41b 64bff5eb

+1585 -34
+1470 -22
Cargo.lock
··· 38 38 source = "registry+https://github.com/rust-lang/crates.io-index" 39 39 checksum = "9e231f6134f61b71076a3eab506c379d4f36122f2af15a9ff04415ea4c3339e2" 40 40 dependencies = [ 41 - "windows-sys", 41 + "windows-sys 0.60.2", 42 42 ] 43 43 44 44 [[package]] ··· 49 49 dependencies = [ 50 50 "anstyle", 51 51 "once_cell_polyfill", 52 - "windows-sys", 52 + "windows-sys 0.60.2", 53 53 ] 54 54 55 55 [[package]] 56 + name = "anyhow" 57 + version = "1.0.100" 58 + source = "registry+https://github.com/rust-lang/crates.io-index" 59 + checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" 60 + 61 + [[package]] 62 + name = "atomic-waker" 63 + version = "1.1.2" 64 + source = "registry+https://github.com/rust-lang/crates.io-index" 65 + checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" 66 + 67 + [[package]] 68 + name = "base64" 69 + version = "0.22.1" 70 + source = "registry+https://github.com/rust-lang/crates.io-index" 71 + checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" 72 + 73 + [[package]] 74 + name = "bitflags" 75 + version = "2.10.0" 76 + source = "registry+https://github.com/rust-lang/crates.io-index" 77 + checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" 78 + 79 + [[package]] 80 + name = "bumpalo" 81 + version = "3.19.0" 82 + source = "registry+https://github.com/rust-lang/crates.io-index" 83 + checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" 84 + 85 + [[package]] 86 + name = "bytes" 87 + version = "1.10.1" 88 + source = "registry+https://github.com/rust-lang/crates.io-index" 89 + checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" 90 + 91 + [[package]] 92 + name = "cc" 93 + version = "1.2.41" 94 + source = "registry+https://github.com/rust-lang/crates.io-index" 95 + checksum = "ac9fe6cdbb24b6ade63616c0a0688e45bb56732262c158df3c0c4bea4ca47cb7" 96 + dependencies = [ 97 + "find-msvc-tools", 98 + "shlex", 99 + ] 100 + 101 + [[package]] 102 + name = "cfg-if" 103 + version = "1.0.4" 104 + source = "registry+https://github.com/rust-lang/crates.io-index" 105 + checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" 106 + 107 + [[package]] 56 108 name = "clap" 57 - version = "4.5.48" 109 + version = "4.5.50" 58 110 source = "registry+https://github.com/rust-lang/crates.io-index" 59 - checksum = "e2134bb3ea021b78629caa971416385309e0131b351b25e01dc16fb54e1b5fae" 111 + checksum = "0c2cfd7bf8a6017ddaa4e32ffe7403d547790db06bd171c1c53926faab501623" 60 112 dependencies = [ 61 113 "clap_builder", 62 114 "clap_derive", ··· 64 116 65 117 [[package]] 66 118 name = "clap_builder" 67 - version = "4.5.48" 119 + version = "4.5.50" 68 120 source = "registry+https://github.com/rust-lang/crates.io-index" 69 - checksum = "c2ba64afa3c0a6df7fa517765e31314e983f51dda798ffba27b988194fb65dc9" 121 + checksum = "0a4c05b9e80c5ccd3a7ef080ad7b6ba7d6fc00a985b8b157197075677c82c7a0" 70 122 dependencies = [ 71 123 "anstream", 72 124 "anstyle", ··· 76 128 77 129 [[package]] 78 130 name = "clap_derive" 79 - version = "4.5.47" 131 + version = "4.5.49" 80 132 source = "registry+https://github.com/rust-lang/crates.io-index" 81 - checksum = "bbfd7eae0b0f1a6e63d4b13c9c478de77c2eb546fba158ad50b4203dc24b9f9c" 133 + checksum = "2a0b5487afeab2deb2ff4e03a807ad1a03ac532ff5a2cee5d86884440c7f7671" 82 134 dependencies = [ 83 135 "heck", 84 136 "proc-macro2", ··· 88 140 89 141 [[package]] 90 142 name = "clap_lex" 91 - version = "0.7.5" 143 + version = "0.7.6" 92 144 source = "registry+https://github.com/rust-lang/crates.io-index" 93 - checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675" 145 + checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d" 94 146 95 147 [[package]] 96 148 name = "colorchoice" ··· 99 151 checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" 100 152 101 153 [[package]] 154 + name = "core-foundation" 155 + version = "0.9.4" 156 + source = "registry+https://github.com/rust-lang/crates.io-index" 157 + checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" 158 + dependencies = [ 159 + "core-foundation-sys", 160 + "libc", 161 + ] 162 + 163 + [[package]] 164 + name = "core-foundation-sys" 165 + version = "0.8.7" 166 + source = "registry+https://github.com/rust-lang/crates.io-index" 167 + checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" 168 + 169 + [[package]] 170 + name = "displaydoc" 171 + version = "0.2.5" 172 + source = "registry+https://github.com/rust-lang/crates.io-index" 173 + checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" 174 + dependencies = [ 175 + "proc-macro2", 176 + "quote", 177 + "syn", 178 + ] 179 + 180 + [[package]] 181 + name = "encoding_rs" 182 + version = "0.8.35" 183 + source = "registry+https://github.com/rust-lang/crates.io-index" 184 + checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" 185 + dependencies = [ 186 + "cfg-if", 187 + ] 188 + 189 + [[package]] 190 + name = "equivalent" 191 + version = "1.0.2" 192 + source = "registry+https://github.com/rust-lang/crates.io-index" 193 + checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" 194 + 195 + [[package]] 196 + name = "errno" 197 + version = "0.3.14" 198 + source = "registry+https://github.com/rust-lang/crates.io-index" 199 + checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" 200 + dependencies = [ 201 + "libc", 202 + "windows-sys 0.61.2", 203 + ] 204 + 205 + [[package]] 206 + name = "fastrand" 207 + version = "2.3.0" 208 + source = "registry+https://github.com/rust-lang/crates.io-index" 209 + checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" 210 + 211 + [[package]] 212 + name = "find-msvc-tools" 213 + version = "0.1.4" 214 + source = "registry+https://github.com/rust-lang/crates.io-index" 215 + checksum = "52051878f80a721bb68ebfbc930e07b65ba72f2da88968ea5c06fd6ca3d3a127" 216 + 217 + [[package]] 218 + name = "fnv" 219 + version = "1.0.7" 220 + source = "registry+https://github.com/rust-lang/crates.io-index" 221 + checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 222 + 223 + [[package]] 224 + name = "foreign-types" 225 + version = "0.3.2" 226 + source = "registry+https://github.com/rust-lang/crates.io-index" 227 + checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" 228 + dependencies = [ 229 + "foreign-types-shared", 230 + ] 231 + 232 + [[package]] 233 + name = "foreign-types-shared" 234 + version = "0.1.1" 235 + source = "registry+https://github.com/rust-lang/crates.io-index" 236 + checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" 237 + 238 + [[package]] 239 + name = "form_urlencoded" 240 + version = "1.2.2" 241 + source = "registry+https://github.com/rust-lang/crates.io-index" 242 + checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" 243 + dependencies = [ 244 + "percent-encoding", 245 + ] 246 + 247 + [[package]] 248 + name = "futures-channel" 249 + version = "0.3.31" 250 + source = "registry+https://github.com/rust-lang/crates.io-index" 251 + checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" 252 + dependencies = [ 253 + "futures-core", 254 + "futures-sink", 255 + ] 256 + 257 + [[package]] 258 + name = "futures-core" 259 + version = "0.3.31" 260 + source = "registry+https://github.com/rust-lang/crates.io-index" 261 + checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" 262 + 263 + [[package]] 264 + name = "futures-io" 265 + version = "0.3.31" 266 + source = "registry+https://github.com/rust-lang/crates.io-index" 267 + checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" 268 + 269 + [[package]] 270 + name = "futures-sink" 271 + version = "0.3.31" 272 + source = "registry+https://github.com/rust-lang/crates.io-index" 273 + checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" 274 + 275 + [[package]] 276 + name = "futures-task" 277 + version = "0.3.31" 278 + source = "registry+https://github.com/rust-lang/crates.io-index" 279 + checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" 280 + 281 + [[package]] 282 + name = "futures-util" 283 + version = "0.3.31" 284 + source = "registry+https://github.com/rust-lang/crates.io-index" 285 + checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" 286 + dependencies = [ 287 + "futures-core", 288 + "futures-io", 289 + "futures-sink", 290 + "futures-task", 291 + "memchr", 292 + "pin-project-lite", 293 + "pin-utils", 294 + "slab", 295 + ] 296 + 297 + [[package]] 298 + name = "getrandom" 299 + version = "0.2.16" 300 + source = "registry+https://github.com/rust-lang/crates.io-index" 301 + checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" 302 + dependencies = [ 303 + "cfg-if", 304 + "libc", 305 + "wasi", 306 + ] 307 + 308 + [[package]] 309 + name = "getrandom" 310 + version = "0.3.4" 311 + source = "registry+https://github.com/rust-lang/crates.io-index" 312 + checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" 313 + dependencies = [ 314 + "cfg-if", 315 + "libc", 316 + "r-efi", 317 + "wasip2", 318 + ] 319 + 320 + [[package]] 321 + name = "h2" 322 + version = "0.4.12" 323 + source = "registry+https://github.com/rust-lang/crates.io-index" 324 + checksum = "f3c0b69cfcb4e1b9f1bf2f53f95f766e4661169728ec61cd3fe5a0166f2d1386" 325 + dependencies = [ 326 + "atomic-waker", 327 + "bytes", 328 + "fnv", 329 + "futures-core", 330 + "futures-sink", 331 + "http", 332 + "indexmap", 333 + "slab", 334 + "tokio", 335 + "tokio-util", 336 + "tracing", 337 + ] 338 + 339 + [[package]] 340 + name = "hashbrown" 341 + version = "0.16.0" 342 + source = "registry+https://github.com/rust-lang/crates.io-index" 343 + checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d" 344 + 345 + [[package]] 102 346 name = "heck" 103 347 version = "0.5.0" 104 348 source = "registry+https://github.com/rust-lang/crates.io-index" 105 349 checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" 106 350 107 351 [[package]] 352 + name = "http" 353 + version = "1.3.1" 354 + source = "registry+https://github.com/rust-lang/crates.io-index" 355 + checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" 356 + dependencies = [ 357 + "bytes", 358 + "fnv", 359 + "itoa", 360 + ] 361 + 362 + [[package]] 363 + name = "http-body" 364 + version = "1.0.1" 365 + source = "registry+https://github.com/rust-lang/crates.io-index" 366 + checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" 367 + dependencies = [ 368 + "bytes", 369 + "http", 370 + ] 371 + 372 + [[package]] 373 + name = "http-body-util" 374 + version = "0.1.3" 375 + source = "registry+https://github.com/rust-lang/crates.io-index" 376 + checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" 377 + dependencies = [ 378 + "bytes", 379 + "futures-core", 380 + "http", 381 + "http-body", 382 + "pin-project-lite", 383 + ] 384 + 385 + [[package]] 386 + name = "httparse" 387 + version = "1.10.1" 388 + source = "registry+https://github.com/rust-lang/crates.io-index" 389 + checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" 390 + 391 + [[package]] 392 + name = "hyper" 393 + version = "1.7.0" 394 + source = "registry+https://github.com/rust-lang/crates.io-index" 395 + checksum = "eb3aa54a13a0dfe7fbe3a59e0c76093041720fdc77b110cc0fc260fafb4dc51e" 396 + dependencies = [ 397 + "atomic-waker", 398 + "bytes", 399 + "futures-channel", 400 + "futures-core", 401 + "h2", 402 + "http", 403 + "http-body", 404 + "httparse", 405 + "itoa", 406 + "pin-project-lite", 407 + "pin-utils", 408 + "smallvec", 409 + "tokio", 410 + "want", 411 + ] 412 + 413 + [[package]] 414 + name = "hyper-rustls" 415 + version = "0.27.7" 416 + source = "registry+https://github.com/rust-lang/crates.io-index" 417 + checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58" 418 + dependencies = [ 419 + "http", 420 + "hyper", 421 + "hyper-util", 422 + "rustls", 423 + "rustls-pki-types", 424 + "tokio", 425 + "tokio-rustls", 426 + "tower-service", 427 + ] 428 + 429 + [[package]] 430 + name = "hyper-tls" 431 + version = "0.6.0" 432 + source = "registry+https://github.com/rust-lang/crates.io-index" 433 + checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" 434 + dependencies = [ 435 + "bytes", 436 + "http-body-util", 437 + "hyper", 438 + "hyper-util", 439 + "native-tls", 440 + "tokio", 441 + "tokio-native-tls", 442 + "tower-service", 443 + ] 444 + 445 + [[package]] 446 + name = "hyper-util" 447 + version = "0.1.17" 448 + source = "registry+https://github.com/rust-lang/crates.io-index" 449 + checksum = "3c6995591a8f1380fcb4ba966a252a4b29188d51d2b89e3a252f5305be65aea8" 450 + dependencies = [ 451 + "base64", 452 + "bytes", 453 + "futures-channel", 454 + "futures-core", 455 + "futures-util", 456 + "http", 457 + "http-body", 458 + "hyper", 459 + "ipnet", 460 + "libc", 461 + "percent-encoding", 462 + "pin-project-lite", 463 + "socket2", 464 + "system-configuration", 465 + "tokio", 466 + "tower-service", 467 + "tracing", 468 + "windows-registry", 469 + ] 470 + 471 + [[package]] 472 + name = "icu_collections" 473 + version = "2.0.0" 474 + source = "registry+https://github.com/rust-lang/crates.io-index" 475 + checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47" 476 + dependencies = [ 477 + "displaydoc", 478 + "potential_utf", 479 + "yoke", 480 + "zerofrom", 481 + "zerovec", 482 + ] 483 + 484 + [[package]] 485 + name = "icu_locale_core" 486 + version = "2.0.0" 487 + source = "registry+https://github.com/rust-lang/crates.io-index" 488 + checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a" 489 + dependencies = [ 490 + "displaydoc", 491 + "litemap", 492 + "tinystr", 493 + "writeable", 494 + "zerovec", 495 + ] 496 + 497 + [[package]] 498 + name = "icu_normalizer" 499 + version = "2.0.0" 500 + source = "registry+https://github.com/rust-lang/crates.io-index" 501 + checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979" 502 + dependencies = [ 503 + "displaydoc", 504 + "icu_collections", 505 + "icu_normalizer_data", 506 + "icu_properties", 507 + "icu_provider", 508 + "smallvec", 509 + "zerovec", 510 + ] 511 + 512 + [[package]] 513 + name = "icu_normalizer_data" 514 + version = "2.0.0" 515 + source = "registry+https://github.com/rust-lang/crates.io-index" 516 + checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3" 517 + 518 + [[package]] 519 + name = "icu_properties" 520 + version = "2.0.1" 521 + source = "registry+https://github.com/rust-lang/crates.io-index" 522 + checksum = "016c619c1eeb94efb86809b015c58f479963de65bdb6253345c1a1276f22e32b" 523 + dependencies = [ 524 + "displaydoc", 525 + "icu_collections", 526 + "icu_locale_core", 527 + "icu_properties_data", 528 + "icu_provider", 529 + "potential_utf", 530 + "zerotrie", 531 + "zerovec", 532 + ] 533 + 534 + [[package]] 535 + name = "icu_properties_data" 536 + version = "2.0.1" 537 + source = "registry+https://github.com/rust-lang/crates.io-index" 538 + checksum = "298459143998310acd25ffe6810ed544932242d3f07083eee1084d83a71bd632" 539 + 540 + [[package]] 541 + name = "icu_provider" 542 + version = "2.0.0" 543 + source = "registry+https://github.com/rust-lang/crates.io-index" 544 + checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af" 545 + dependencies = [ 546 + "displaydoc", 547 + "icu_locale_core", 548 + "stable_deref_trait", 549 + "tinystr", 550 + "writeable", 551 + "yoke", 552 + "zerofrom", 553 + "zerotrie", 554 + "zerovec", 555 + ] 556 + 557 + [[package]] 558 + name = "idna" 559 + version = "1.1.0" 560 + source = "registry+https://github.com/rust-lang/crates.io-index" 561 + checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" 562 + dependencies = [ 563 + "idna_adapter", 564 + "smallvec", 565 + "utf8_iter", 566 + ] 567 + 568 + [[package]] 569 + name = "idna_adapter" 570 + version = "1.2.1" 571 + source = "registry+https://github.com/rust-lang/crates.io-index" 572 + checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" 573 + dependencies = [ 574 + "icu_normalizer", 575 + "icu_properties", 576 + ] 577 + 578 + [[package]] 579 + name = "indexmap" 580 + version = "2.12.0" 581 + source = "registry+https://github.com/rust-lang/crates.io-index" 582 + checksum = "6717a8d2a5a929a1a2eb43a12812498ed141a0bcfb7e8f7844fbdbe4303bba9f" 583 + dependencies = [ 584 + "equivalent", 585 + "hashbrown", 586 + ] 587 + 588 + [[package]] 589 + name = "ipnet" 590 + version = "2.11.0" 591 + source = "registry+https://github.com/rust-lang/crates.io-index" 592 + checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" 593 + 594 + [[package]] 595 + name = "iri-string" 596 + version = "0.7.8" 597 + source = "registry+https://github.com/rust-lang/crates.io-index" 598 + checksum = "dbc5ebe9c3a1a7a5127f920a418f7585e9e758e911d0466ed004f393b0e380b2" 599 + dependencies = [ 600 + "memchr", 601 + "serde", 602 + ] 603 + 604 + [[package]] 108 605 name = "is_terminal_polyfill" 109 606 version = "1.70.1" 110 607 source = "registry+https://github.com/rust-lang/crates.io-index" 111 608 checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" 112 609 113 610 [[package]] 611 + name = "itoa" 612 + version = "1.0.15" 613 + source = "registry+https://github.com/rust-lang/crates.io-index" 614 + checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" 615 + 616 + [[package]] 617 + name = "js-sys" 618 + version = "0.3.81" 619 + source = "registry+https://github.com/rust-lang/crates.io-index" 620 + checksum = "ec48937a97411dcb524a265206ccd4c90bb711fca92b2792c407f268825b9305" 621 + dependencies = [ 622 + "once_cell", 623 + "wasm-bindgen", 624 + ] 625 + 626 + [[package]] 627 + name = "libc" 628 + version = "0.2.177" 629 + source = "registry+https://github.com/rust-lang/crates.io-index" 630 + checksum = "2874a2af47a2325c2001a6e6fad9b16a53b802102b528163885171cf92b15976" 631 + 632 + [[package]] 633 + name = "linux-raw-sys" 634 + version = "0.11.0" 635 + source = "registry+https://github.com/rust-lang/crates.io-index" 636 + checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039" 637 + 638 + [[package]] 639 + name = "litemap" 640 + version = "0.8.0" 641 + source = "registry+https://github.com/rust-lang/crates.io-index" 642 + checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" 643 + 644 + [[package]] 645 + name = "log" 646 + version = "0.4.28" 647 + source = "registry+https://github.com/rust-lang/crates.io-index" 648 + checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432" 649 + 650 + [[package]] 114 651 name = "memchr" 115 652 version = "2.7.6" 116 653 source = "registry+https://github.com/rust-lang/crates.io-index" 117 654 checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" 118 655 119 656 [[package]] 657 + name = "mime" 658 + version = "0.3.17" 659 + source = "registry+https://github.com/rust-lang/crates.io-index" 660 + checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" 661 + 662 + [[package]] 663 + name = "mio" 664 + version = "1.1.0" 665 + source = "registry+https://github.com/rust-lang/crates.io-index" 666 + checksum = "69d83b0086dc8ecf3ce9ae2874b2d1290252e2a30720bea58a5c6639b0092873" 667 + dependencies = [ 668 + "libc", 669 + "wasi", 670 + "windows-sys 0.61.2", 671 + ] 672 + 673 + [[package]] 674 + name = "native-tls" 675 + version = "0.2.14" 676 + source = "registry+https://github.com/rust-lang/crates.io-index" 677 + checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e" 678 + dependencies = [ 679 + "libc", 680 + "log", 681 + "openssl", 682 + "openssl-probe", 683 + "openssl-sys", 684 + "schannel", 685 + "security-framework", 686 + "security-framework-sys", 687 + "tempfile", 688 + ] 689 + 690 + [[package]] 120 691 name = "nom" 121 692 version = "8.0.0" 122 693 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 126 697 ] 127 698 128 699 [[package]] 700 + name = "once_cell" 701 + version = "1.21.3" 702 + source = "registry+https://github.com/rust-lang/crates.io-index" 703 + checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" 704 + 705 + [[package]] 129 706 name = "once_cell_polyfill" 130 707 version = "1.70.1" 131 708 source = "registry+https://github.com/rust-lang/crates.io-index" 132 709 checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" 133 710 134 711 [[package]] 712 + name = "openssl" 713 + version = "0.10.74" 714 + source = "registry+https://github.com/rust-lang/crates.io-index" 715 + checksum = "24ad14dd45412269e1a30f52ad8f0664f0f4f4a89ee8fe28c3b3527021ebb654" 716 + dependencies = [ 717 + "bitflags", 718 + "cfg-if", 719 + "foreign-types", 720 + "libc", 721 + "once_cell", 722 + "openssl-macros", 723 + "openssl-sys", 724 + ] 725 + 726 + [[package]] 727 + name = "openssl-macros" 728 + version = "0.1.1" 729 + source = "registry+https://github.com/rust-lang/crates.io-index" 730 + checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" 731 + dependencies = [ 732 + "proc-macro2", 733 + "quote", 734 + "syn", 735 + ] 736 + 737 + [[package]] 738 + name = "openssl-probe" 739 + version = "0.1.6" 740 + source = "registry+https://github.com/rust-lang/crates.io-index" 741 + checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" 742 + 743 + [[package]] 744 + name = "openssl-sys" 745 + version = "0.9.110" 746 + source = "registry+https://github.com/rust-lang/crates.io-index" 747 + checksum = "0a9f0075ba3c21b09f8e8b2026584b1d18d49388648f2fbbf3c97ea8deced8e2" 748 + dependencies = [ 749 + "cc", 750 + "libc", 751 + "pkg-config", 752 + "vcpkg", 753 + ] 754 + 755 + [[package]] 756 + name = "percent-encoding" 757 + version = "2.3.2" 758 + source = "registry+https://github.com/rust-lang/crates.io-index" 759 + checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" 760 + 761 + [[package]] 762 + name = "pin-project-lite" 763 + version = "0.2.16" 764 + source = "registry+https://github.com/rust-lang/crates.io-index" 765 + checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" 766 + 767 + [[package]] 768 + name = "pin-utils" 769 + version = "0.1.0" 770 + source = "registry+https://github.com/rust-lang/crates.io-index" 771 + checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 772 + 773 + [[package]] 774 + name = "pkg-config" 775 + version = "0.3.32" 776 + source = "registry+https://github.com/rust-lang/crates.io-index" 777 + checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" 778 + 779 + [[package]] 780 + name = "potential_utf" 781 + version = "0.1.3" 782 + source = "registry+https://github.com/rust-lang/crates.io-index" 783 + checksum = "84df19adbe5b5a0782edcab45899906947ab039ccf4573713735ee7de1e6b08a" 784 + dependencies = [ 785 + "zerovec", 786 + ] 787 + 788 + [[package]] 135 789 name = "proc-macro2" 136 790 version = "1.0.101" 137 791 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 150 804 ] 151 805 152 806 [[package]] 807 + name = "r-efi" 808 + version = "5.3.0" 809 + source = "registry+https://github.com/rust-lang/crates.io-index" 810 + checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" 811 + 812 + [[package]] 813 + name = "reqwest" 814 + version = "0.12.24" 815 + source = "registry+https://github.com/rust-lang/crates.io-index" 816 + checksum = "9d0946410b9f7b082a427e4ef5c8ff541a88b357bc6c637c40db3a68ac70a36f" 817 + dependencies = [ 818 + "base64", 819 + "bytes", 820 + "encoding_rs", 821 + "futures-channel", 822 + "futures-core", 823 + "futures-util", 824 + "h2", 825 + "http", 826 + "http-body", 827 + "http-body-util", 828 + "hyper", 829 + "hyper-rustls", 830 + "hyper-tls", 831 + "hyper-util", 832 + "js-sys", 833 + "log", 834 + "mime", 835 + "native-tls", 836 + "percent-encoding", 837 + "pin-project-lite", 838 + "rustls-pki-types", 839 + "serde", 840 + "serde_json", 841 + "serde_urlencoded", 842 + "sync_wrapper", 843 + "tokio", 844 + "tokio-native-tls", 845 + "tower", 846 + "tower-http", 847 + "tower-service", 848 + "url", 849 + "wasm-bindgen", 850 + "wasm-bindgen-futures", 851 + "web-sys", 852 + ] 853 + 854 + [[package]] 855 + name = "ring" 856 + version = "0.17.14" 857 + source = "registry+https://github.com/rust-lang/crates.io-index" 858 + checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" 859 + dependencies = [ 860 + "cc", 861 + "cfg-if", 862 + "getrandom 0.2.16", 863 + "libc", 864 + "untrusted", 865 + "windows-sys 0.52.0", 866 + ] 867 + 868 + [[package]] 869 + name = "rustix" 870 + version = "1.1.2" 871 + source = "registry+https://github.com/rust-lang/crates.io-index" 872 + checksum = "cd15f8a2c5551a84d56efdc1cd049089e409ac19a3072d5037a17fd70719ff3e" 873 + dependencies = [ 874 + "bitflags", 875 + "errno", 876 + "libc", 877 + "linux-raw-sys", 878 + "windows-sys 0.61.2", 879 + ] 880 + 881 + [[package]] 882 + name = "rustls" 883 + version = "0.23.33" 884 + source = "registry+https://github.com/rust-lang/crates.io-index" 885 + checksum = "751e04a496ca00bb97a5e043158d23d66b5aabf2e1d5aa2a0aaebb1aafe6f82c" 886 + dependencies = [ 887 + "once_cell", 888 + "rustls-pki-types", 889 + "rustls-webpki", 890 + "subtle", 891 + "zeroize", 892 + ] 893 + 894 + [[package]] 895 + name = "rustls-pki-types" 896 + version = "1.12.0" 897 + source = "registry+https://github.com/rust-lang/crates.io-index" 898 + checksum = "229a4a4c221013e7e1f1a043678c5cc39fe5171437c88fb47151a21e6f5b5c79" 899 + dependencies = [ 900 + "zeroize", 901 + ] 902 + 903 + [[package]] 904 + name = "rustls-webpki" 905 + version = "0.103.7" 906 + source = "registry+https://github.com/rust-lang/crates.io-index" 907 + checksum = "e10b3f4191e8a80e6b43eebabfac91e5dcecebb27a71f04e820c47ec41d314bf" 908 + dependencies = [ 909 + "ring", 910 + "rustls-pki-types", 911 + "untrusted", 912 + ] 913 + 914 + [[package]] 915 + name = "rustversion" 916 + version = "1.0.22" 917 + source = "registry+https://github.com/rust-lang/crates.io-index" 918 + checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" 919 + 920 + [[package]] 921 + name = "ryu" 922 + version = "1.0.20" 923 + source = "registry+https://github.com/rust-lang/crates.io-index" 924 + checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" 925 + 926 + [[package]] 927 + name = "schannel" 928 + version = "0.1.28" 929 + source = "registry+https://github.com/rust-lang/crates.io-index" 930 + checksum = "891d81b926048e76efe18581bf793546b4c0eaf8448d72be8de2bbee5fd166e1" 931 + dependencies = [ 932 + "windows-sys 0.61.2", 933 + ] 934 + 935 + [[package]] 936 + name = "security-framework" 937 + version = "2.11.1" 938 + source = "registry+https://github.com/rust-lang/crates.io-index" 939 + checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" 940 + dependencies = [ 941 + "bitflags", 942 + "core-foundation", 943 + "core-foundation-sys", 944 + "libc", 945 + "security-framework-sys", 946 + ] 947 + 948 + [[package]] 949 + name = "security-framework-sys" 950 + version = "2.15.0" 951 + source = "registry+https://github.com/rust-lang/crates.io-index" 952 + checksum = "cc1f0cbffaac4852523ce30d8bd3c5cdc873501d96ff467ca09b6767bb8cd5c0" 953 + dependencies = [ 954 + "core-foundation-sys", 955 + "libc", 956 + ] 957 + 958 + [[package]] 959 + name = "serde" 960 + version = "1.0.228" 961 + source = "registry+https://github.com/rust-lang/crates.io-index" 962 + checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" 963 + dependencies = [ 964 + "serde_core", 965 + "serde_derive", 966 + ] 967 + 968 + [[package]] 969 + name = "serde_core" 970 + version = "1.0.228" 971 + source = "registry+https://github.com/rust-lang/crates.io-index" 972 + checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" 973 + dependencies = [ 974 + "serde_derive", 975 + ] 976 + 977 + [[package]] 978 + name = "serde_derive" 979 + version = "1.0.228" 980 + source = "registry+https://github.com/rust-lang/crates.io-index" 981 + checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" 982 + dependencies = [ 983 + "proc-macro2", 984 + "quote", 985 + "syn", 986 + ] 987 + 988 + [[package]] 989 + name = "serde_json" 990 + version = "1.0.145" 991 + source = "registry+https://github.com/rust-lang/crates.io-index" 992 + checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c" 993 + dependencies = [ 994 + "itoa", 995 + "memchr", 996 + "ryu", 997 + "serde", 998 + "serde_core", 999 + ] 1000 + 1001 + [[package]] 1002 + name = "serde_urlencoded" 1003 + version = "0.7.1" 1004 + source = "registry+https://github.com/rust-lang/crates.io-index" 1005 + checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" 1006 + dependencies = [ 1007 + "form_urlencoded", 1008 + "itoa", 1009 + "ryu", 1010 + "serde", 1011 + ] 1012 + 1013 + [[package]] 1014 + name = "shlex" 1015 + version = "1.3.0" 1016 + source = "registry+https://github.com/rust-lang/crates.io-index" 1017 + checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" 1018 + 1019 + [[package]] 1020 + name = "slab" 1021 + version = "0.4.11" 1022 + source = "registry+https://github.com/rust-lang/crates.io-index" 1023 + checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589" 1024 + 1025 + [[package]] 1026 + name = "smallvec" 1027 + version = "1.15.1" 1028 + source = "registry+https://github.com/rust-lang/crates.io-index" 1029 + checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" 1030 + 1031 + [[package]] 1032 + name = "socket2" 1033 + version = "0.6.1" 1034 + source = "registry+https://github.com/rust-lang/crates.io-index" 1035 + checksum = "17129e116933cf371d018bb80ae557e889637989d8638274fb25622827b03881" 1036 + dependencies = [ 1037 + "libc", 1038 + "windows-sys 0.60.2", 1039 + ] 1040 + 1041 + [[package]] 1042 + name = "stable_deref_trait" 1043 + version = "1.2.1" 1044 + source = "registry+https://github.com/rust-lang/crates.io-index" 1045 + checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" 1046 + 1047 + [[package]] 153 1048 name = "strsim" 154 1049 version = "0.11.1" 155 1050 source = "registry+https://github.com/rust-lang/crates.io-index" 156 1051 checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" 157 1052 158 1053 [[package]] 1054 + name = "subtle" 1055 + version = "2.6.1" 1056 + source = "registry+https://github.com/rust-lang/crates.io-index" 1057 + checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" 1058 + 1059 + [[package]] 159 1060 name = "syn" 160 - version = "2.0.106" 1061 + version = "2.0.107" 161 1062 source = "registry+https://github.com/rust-lang/crates.io-index" 162 - checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6" 1063 + checksum = "2a26dbd934e5451d21ef060c018dae56fc073894c5a7896f882928a76e6d081b" 163 1064 dependencies = [ 164 1065 "proc-macro2", 165 1066 "quote", ··· 167 1068 ] 168 1069 169 1070 [[package]] 1071 + name = "sync_wrapper" 1072 + version = "1.0.2" 1073 + source = "registry+https://github.com/rust-lang/crates.io-index" 1074 + checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" 1075 + dependencies = [ 1076 + "futures-core", 1077 + ] 1078 + 1079 + [[package]] 1080 + name = "synstructure" 1081 + version = "0.13.2" 1082 + source = "registry+https://github.com/rust-lang/crates.io-index" 1083 + checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" 1084 + dependencies = [ 1085 + "proc-macro2", 1086 + "quote", 1087 + "syn", 1088 + ] 1089 + 1090 + [[package]] 1091 + name = "system-configuration" 1092 + version = "0.6.1" 1093 + source = "registry+https://github.com/rust-lang/crates.io-index" 1094 + checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" 1095 + dependencies = [ 1096 + "bitflags", 1097 + "core-foundation", 1098 + "system-configuration-sys", 1099 + ] 1100 + 1101 + [[package]] 1102 + name = "system-configuration-sys" 1103 + version = "0.6.0" 1104 + source = "registry+https://github.com/rust-lang/crates.io-index" 1105 + checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" 1106 + dependencies = [ 1107 + "core-foundation-sys", 1108 + "libc", 1109 + ] 1110 + 1111 + [[package]] 1112 + name = "tempfile" 1113 + version = "3.23.0" 1114 + source = "registry+https://github.com/rust-lang/crates.io-index" 1115 + checksum = "2d31c77bdf42a745371d260a26ca7163f1e0924b64afa0b688e61b5a9fa02f16" 1116 + dependencies = [ 1117 + "fastrand", 1118 + "getrandom 0.3.4", 1119 + "once_cell", 1120 + "rustix", 1121 + "windows-sys 0.61.2", 1122 + ] 1123 + 1124 + [[package]] 170 1125 name = "tiles" 171 1126 version = "0.1.0" 172 1127 dependencies = [ 1128 + "anyhow", 173 1129 "clap", 174 1130 "nom", 1131 + "reqwest", 1132 + "serde", 1133 + "serde_json", 1134 + "tokio", 175 1135 ] 176 1136 177 1137 [[package]] 1138 + name = "tinystr" 1139 + version = "0.8.1" 1140 + source = "registry+https://github.com/rust-lang/crates.io-index" 1141 + checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b" 1142 + dependencies = [ 1143 + "displaydoc", 1144 + "zerovec", 1145 + ] 1146 + 1147 + [[package]] 1148 + name = "tokio" 1149 + version = "1.48.0" 1150 + source = "registry+https://github.com/rust-lang/crates.io-index" 1151 + checksum = "ff360e02eab121e0bc37a2d3b4d4dc622e6eda3a8e5253d5435ecf5bd4c68408" 1152 + dependencies = [ 1153 + "bytes", 1154 + "libc", 1155 + "mio", 1156 + "pin-project-lite", 1157 + "socket2", 1158 + "tokio-macros", 1159 + "windows-sys 0.61.2", 1160 + ] 1161 + 1162 + [[package]] 1163 + name = "tokio-macros" 1164 + version = "2.6.0" 1165 + source = "registry+https://github.com/rust-lang/crates.io-index" 1166 + checksum = "af407857209536a95c8e56f8231ef2c2e2aff839b22e07a1ffcbc617e9db9fa5" 1167 + dependencies = [ 1168 + "proc-macro2", 1169 + "quote", 1170 + "syn", 1171 + ] 1172 + 1173 + [[package]] 1174 + name = "tokio-native-tls" 1175 + version = "0.3.1" 1176 + source = "registry+https://github.com/rust-lang/crates.io-index" 1177 + checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" 1178 + dependencies = [ 1179 + "native-tls", 1180 + "tokio", 1181 + ] 1182 + 1183 + [[package]] 1184 + name = "tokio-rustls" 1185 + version = "0.26.4" 1186 + source = "registry+https://github.com/rust-lang/crates.io-index" 1187 + checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" 1188 + dependencies = [ 1189 + "rustls", 1190 + "tokio", 1191 + ] 1192 + 1193 + [[package]] 1194 + name = "tokio-util" 1195 + version = "0.7.16" 1196 + source = "registry+https://github.com/rust-lang/crates.io-index" 1197 + checksum = "14307c986784f72ef81c89db7d9e28d6ac26d16213b109ea501696195e6e3ce5" 1198 + dependencies = [ 1199 + "bytes", 1200 + "futures-core", 1201 + "futures-sink", 1202 + "pin-project-lite", 1203 + "tokio", 1204 + ] 1205 + 1206 + [[package]] 1207 + name = "tower" 1208 + version = "0.5.2" 1209 + source = "registry+https://github.com/rust-lang/crates.io-index" 1210 + checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" 1211 + dependencies = [ 1212 + "futures-core", 1213 + "futures-util", 1214 + "pin-project-lite", 1215 + "sync_wrapper", 1216 + "tokio", 1217 + "tower-layer", 1218 + "tower-service", 1219 + ] 1220 + 1221 + [[package]] 1222 + name = "tower-http" 1223 + version = "0.6.6" 1224 + source = "registry+https://github.com/rust-lang/crates.io-index" 1225 + checksum = "adc82fd73de2a9722ac5da747f12383d2bfdb93591ee6c58486e0097890f05f2" 1226 + dependencies = [ 1227 + "bitflags", 1228 + "bytes", 1229 + "futures-util", 1230 + "http", 1231 + "http-body", 1232 + "iri-string", 1233 + "pin-project-lite", 1234 + "tower", 1235 + "tower-layer", 1236 + "tower-service", 1237 + ] 1238 + 1239 + [[package]] 1240 + name = "tower-layer" 1241 + version = "0.3.3" 1242 + source = "registry+https://github.com/rust-lang/crates.io-index" 1243 + checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" 1244 + 1245 + [[package]] 1246 + name = "tower-service" 1247 + version = "0.3.3" 1248 + source = "registry+https://github.com/rust-lang/crates.io-index" 1249 + checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" 1250 + 1251 + [[package]] 1252 + name = "tracing" 1253 + version = "0.1.41" 1254 + source = "registry+https://github.com/rust-lang/crates.io-index" 1255 + checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" 1256 + dependencies = [ 1257 + "pin-project-lite", 1258 + "tracing-core", 1259 + ] 1260 + 1261 + [[package]] 1262 + name = "tracing-core" 1263 + version = "0.1.34" 1264 + source = "registry+https://github.com/rust-lang/crates.io-index" 1265 + checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" 1266 + dependencies = [ 1267 + "once_cell", 1268 + ] 1269 + 1270 + [[package]] 1271 + name = "try-lock" 1272 + version = "0.2.5" 1273 + source = "registry+https://github.com/rust-lang/crates.io-index" 1274 + checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" 1275 + 1276 + [[package]] 178 1277 name = "unicode-ident" 179 1278 version = "1.0.19" 180 1279 source = "registry+https://github.com/rust-lang/crates.io-index" 181 1280 checksum = "f63a545481291138910575129486daeaf8ac54aee4387fe7906919f7830c7d9d" 182 1281 183 1282 [[package]] 1283 + name = "untrusted" 1284 + version = "0.9.0" 1285 + source = "registry+https://github.com/rust-lang/crates.io-index" 1286 + checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" 1287 + 1288 + [[package]] 1289 + name = "url" 1290 + version = "2.5.7" 1291 + source = "registry+https://github.com/rust-lang/crates.io-index" 1292 + checksum = "08bc136a29a3d1758e07a9cca267be308aeebf5cfd5a10f3f67ab2097683ef5b" 1293 + dependencies = [ 1294 + "form_urlencoded", 1295 + "idna", 1296 + "percent-encoding", 1297 + "serde", 1298 + ] 1299 + 1300 + [[package]] 1301 + name = "utf8_iter" 1302 + version = "1.0.4" 1303 + source = "registry+https://github.com/rust-lang/crates.io-index" 1304 + checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" 1305 + 1306 + [[package]] 184 1307 name = "utf8parse" 185 1308 version = "0.2.2" 186 1309 source = "registry+https://github.com/rust-lang/crates.io-index" 187 1310 checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" 188 1311 189 1312 [[package]] 1313 + name = "vcpkg" 1314 + version = "0.2.15" 1315 + source = "registry+https://github.com/rust-lang/crates.io-index" 1316 + checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" 1317 + 1318 + [[package]] 1319 + name = "want" 1320 + version = "0.3.1" 1321 + source = "registry+https://github.com/rust-lang/crates.io-index" 1322 + checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" 1323 + dependencies = [ 1324 + "try-lock", 1325 + ] 1326 + 1327 + [[package]] 1328 + name = "wasi" 1329 + version = "0.11.1+wasi-snapshot-preview1" 1330 + source = "registry+https://github.com/rust-lang/crates.io-index" 1331 + checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" 1332 + 1333 + [[package]] 1334 + name = "wasip2" 1335 + version = "1.0.1+wasi-0.2.4" 1336 + source = "registry+https://github.com/rust-lang/crates.io-index" 1337 + checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7" 1338 + dependencies = [ 1339 + "wit-bindgen", 1340 + ] 1341 + 1342 + [[package]] 1343 + name = "wasm-bindgen" 1344 + version = "0.2.104" 1345 + source = "registry+https://github.com/rust-lang/crates.io-index" 1346 + checksum = "c1da10c01ae9f1ae40cbfac0bac3b1e724b320abfcf52229f80b547c0d250e2d" 1347 + dependencies = [ 1348 + "cfg-if", 1349 + "once_cell", 1350 + "rustversion", 1351 + "wasm-bindgen-macro", 1352 + "wasm-bindgen-shared", 1353 + ] 1354 + 1355 + [[package]] 1356 + name = "wasm-bindgen-backend" 1357 + version = "0.2.104" 1358 + source = "registry+https://github.com/rust-lang/crates.io-index" 1359 + checksum = "671c9a5a66f49d8a47345ab942e2cb93c7d1d0339065d4f8139c486121b43b19" 1360 + dependencies = [ 1361 + "bumpalo", 1362 + "log", 1363 + "proc-macro2", 1364 + "quote", 1365 + "syn", 1366 + "wasm-bindgen-shared", 1367 + ] 1368 + 1369 + [[package]] 1370 + name = "wasm-bindgen-futures" 1371 + version = "0.4.54" 1372 + source = "registry+https://github.com/rust-lang/crates.io-index" 1373 + checksum = "7e038d41e478cc73bae0ff9b36c60cff1c98b8f38f8d7e8061e79ee63608ac5c" 1374 + dependencies = [ 1375 + "cfg-if", 1376 + "js-sys", 1377 + "once_cell", 1378 + "wasm-bindgen", 1379 + "web-sys", 1380 + ] 1381 + 1382 + [[package]] 1383 + name = "wasm-bindgen-macro" 1384 + version = "0.2.104" 1385 + source = "registry+https://github.com/rust-lang/crates.io-index" 1386 + checksum = "7ca60477e4c59f5f2986c50191cd972e3a50d8a95603bc9434501cf156a9a119" 1387 + dependencies = [ 1388 + "quote", 1389 + "wasm-bindgen-macro-support", 1390 + ] 1391 + 1392 + [[package]] 1393 + name = "wasm-bindgen-macro-support" 1394 + version = "0.2.104" 1395 + source = "registry+https://github.com/rust-lang/crates.io-index" 1396 + checksum = "9f07d2f20d4da7b26400c9f4a0511e6e0345b040694e8a75bd41d578fa4421d7" 1397 + dependencies = [ 1398 + "proc-macro2", 1399 + "quote", 1400 + "syn", 1401 + "wasm-bindgen-backend", 1402 + "wasm-bindgen-shared", 1403 + ] 1404 + 1405 + [[package]] 1406 + name = "wasm-bindgen-shared" 1407 + version = "0.2.104" 1408 + source = "registry+https://github.com/rust-lang/crates.io-index" 1409 + checksum = "bad67dc8b2a1a6e5448428adec4c3e84c43e561d8c9ee8a9e5aabeb193ec41d1" 1410 + dependencies = [ 1411 + "unicode-ident", 1412 + ] 1413 + 1414 + [[package]] 1415 + name = "web-sys" 1416 + version = "0.3.81" 1417 + source = "registry+https://github.com/rust-lang/crates.io-index" 1418 + checksum = "9367c417a924a74cae129e6a2ae3b47fabb1f8995595ab474029da749a8be120" 1419 + dependencies = [ 1420 + "js-sys", 1421 + "wasm-bindgen", 1422 + ] 1423 + 1424 + [[package]] 1425 + name = "windows-link" 1426 + version = "0.1.3" 1427 + source = "registry+https://github.com/rust-lang/crates.io-index" 1428 + checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" 1429 + 1430 + [[package]] 190 1431 name = "windows-link" 191 1432 version = "0.2.1" 192 1433 source = "registry+https://github.com/rust-lang/crates.io-index" 193 1434 checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" 194 1435 195 1436 [[package]] 1437 + name = "windows-registry" 1438 + version = "0.5.3" 1439 + source = "registry+https://github.com/rust-lang/crates.io-index" 1440 + checksum = "5b8a9ed28765efc97bbc954883f4e6796c33a06546ebafacbabee9696967499e" 1441 + dependencies = [ 1442 + "windows-link 0.1.3", 1443 + "windows-result", 1444 + "windows-strings", 1445 + ] 1446 + 1447 + [[package]] 1448 + name = "windows-result" 1449 + version = "0.3.4" 1450 + source = "registry+https://github.com/rust-lang/crates.io-index" 1451 + checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" 1452 + dependencies = [ 1453 + "windows-link 0.1.3", 1454 + ] 1455 + 1456 + [[package]] 1457 + name = "windows-strings" 1458 + version = "0.4.2" 1459 + source = "registry+https://github.com/rust-lang/crates.io-index" 1460 + checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" 1461 + dependencies = [ 1462 + "windows-link 0.1.3", 1463 + ] 1464 + 1465 + [[package]] 1466 + name = "windows-sys" 1467 + version = "0.52.0" 1468 + source = "registry+https://github.com/rust-lang/crates.io-index" 1469 + checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" 1470 + dependencies = [ 1471 + "windows-targets 0.52.6", 1472 + ] 1473 + 1474 + [[package]] 196 1475 name = "windows-sys" 197 1476 version = "0.60.2" 198 1477 source = "registry+https://github.com/rust-lang/crates.io-index" 199 1478 checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" 200 1479 dependencies = [ 201 - "windows-targets", 1480 + "windows-targets 0.53.5", 1481 + ] 1482 + 1483 + [[package]] 1484 + name = "windows-sys" 1485 + version = "0.61.2" 1486 + source = "registry+https://github.com/rust-lang/crates.io-index" 1487 + checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" 1488 + dependencies = [ 1489 + "windows-link 0.2.1", 1490 + ] 1491 + 1492 + [[package]] 1493 + name = "windows-targets" 1494 + version = "0.52.6" 1495 + source = "registry+https://github.com/rust-lang/crates.io-index" 1496 + checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" 1497 + dependencies = [ 1498 + "windows_aarch64_gnullvm 0.52.6", 1499 + "windows_aarch64_msvc 0.52.6", 1500 + "windows_i686_gnu 0.52.6", 1501 + "windows_i686_gnullvm 0.52.6", 1502 + "windows_i686_msvc 0.52.6", 1503 + "windows_x86_64_gnu 0.52.6", 1504 + "windows_x86_64_gnullvm 0.52.6", 1505 + "windows_x86_64_msvc 0.52.6", 202 1506 ] 203 1507 204 1508 [[package]] ··· 207 1511 source = "registry+https://github.com/rust-lang/crates.io-index" 208 1512 checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" 209 1513 dependencies = [ 210 - "windows-link", 211 - "windows_aarch64_gnullvm", 212 - "windows_aarch64_msvc", 213 - "windows_i686_gnu", 214 - "windows_i686_gnullvm", 215 - "windows_i686_msvc", 216 - "windows_x86_64_gnu", 217 - "windows_x86_64_gnullvm", 218 - "windows_x86_64_msvc", 1514 + "windows-link 0.2.1", 1515 + "windows_aarch64_gnullvm 0.53.1", 1516 + "windows_aarch64_msvc 0.53.1", 1517 + "windows_i686_gnu 0.53.1", 1518 + "windows_i686_gnullvm 0.53.1", 1519 + "windows_i686_msvc 0.53.1", 1520 + "windows_x86_64_gnu 0.53.1", 1521 + "windows_x86_64_gnullvm 0.53.1", 1522 + "windows_x86_64_msvc 0.53.1", 219 1523 ] 220 1524 221 1525 [[package]] 222 1526 name = "windows_aarch64_gnullvm" 1527 + version = "0.52.6" 1528 + source = "registry+https://github.com/rust-lang/crates.io-index" 1529 + checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" 1530 + 1531 + [[package]] 1532 + name = "windows_aarch64_gnullvm" 223 1533 version = "0.53.1" 224 1534 source = "registry+https://github.com/rust-lang/crates.io-index" 225 1535 checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" 226 1536 227 1537 [[package]] 228 1538 name = "windows_aarch64_msvc" 1539 + version = "0.52.6" 1540 + source = "registry+https://github.com/rust-lang/crates.io-index" 1541 + checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" 1542 + 1543 + [[package]] 1544 + name = "windows_aarch64_msvc" 229 1545 version = "0.53.1" 230 1546 source = "registry+https://github.com/rust-lang/crates.io-index" 231 1547 checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" 232 1548 233 1549 [[package]] 234 1550 name = "windows_i686_gnu" 1551 + version = "0.52.6" 1552 + source = "registry+https://github.com/rust-lang/crates.io-index" 1553 + checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" 1554 + 1555 + [[package]] 1556 + name = "windows_i686_gnu" 235 1557 version = "0.53.1" 236 1558 source = "registry+https://github.com/rust-lang/crates.io-index" 237 1559 checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" 238 1560 239 1561 [[package]] 240 1562 name = "windows_i686_gnullvm" 1563 + version = "0.52.6" 1564 + source = "registry+https://github.com/rust-lang/crates.io-index" 1565 + checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" 1566 + 1567 + [[package]] 1568 + name = "windows_i686_gnullvm" 241 1569 version = "0.53.1" 242 1570 source = "registry+https://github.com/rust-lang/crates.io-index" 243 1571 checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" 244 1572 245 1573 [[package]] 246 1574 name = "windows_i686_msvc" 1575 + version = "0.52.6" 1576 + source = "registry+https://github.com/rust-lang/crates.io-index" 1577 + checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" 1578 + 1579 + [[package]] 1580 + name = "windows_i686_msvc" 247 1581 version = "0.53.1" 248 1582 source = "registry+https://github.com/rust-lang/crates.io-index" 249 1583 checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" 250 1584 251 1585 [[package]] 252 1586 name = "windows_x86_64_gnu" 1587 + version = "0.52.6" 1588 + source = "registry+https://github.com/rust-lang/crates.io-index" 1589 + checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" 1590 + 1591 + [[package]] 1592 + name = "windows_x86_64_gnu" 253 1593 version = "0.53.1" 254 1594 source = "registry+https://github.com/rust-lang/crates.io-index" 255 1595 checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" 256 1596 257 1597 [[package]] 258 1598 name = "windows_x86_64_gnullvm" 1599 + version = "0.52.6" 1600 + source = "registry+https://github.com/rust-lang/crates.io-index" 1601 + checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" 1602 + 1603 + [[package]] 1604 + name = "windows_x86_64_gnullvm" 259 1605 version = "0.53.1" 260 1606 source = "registry+https://github.com/rust-lang/crates.io-index" 261 1607 checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" 262 1608 263 1609 [[package]] 264 1610 name = "windows_x86_64_msvc" 1611 + version = "0.52.6" 1612 + source = "registry+https://github.com/rust-lang/crates.io-index" 1613 + checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" 1614 + 1615 + [[package]] 1616 + name = "windows_x86_64_msvc" 265 1617 version = "0.53.1" 266 1618 source = "registry+https://github.com/rust-lang/crates.io-index" 267 1619 checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" 1620 + 1621 + [[package]] 1622 + name = "wit-bindgen" 1623 + version = "0.46.0" 1624 + source = "registry+https://github.com/rust-lang/crates.io-index" 1625 + checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" 1626 + 1627 + [[package]] 1628 + name = "writeable" 1629 + version = "0.6.1" 1630 + source = "registry+https://github.com/rust-lang/crates.io-index" 1631 + checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" 1632 + 1633 + [[package]] 1634 + name = "yoke" 1635 + version = "0.8.0" 1636 + source = "registry+https://github.com/rust-lang/crates.io-index" 1637 + checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc" 1638 + dependencies = [ 1639 + "serde", 1640 + "stable_deref_trait", 1641 + "yoke-derive", 1642 + "zerofrom", 1643 + ] 1644 + 1645 + [[package]] 1646 + name = "yoke-derive" 1647 + version = "0.8.0" 1648 + source = "registry+https://github.com/rust-lang/crates.io-index" 1649 + checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" 1650 + dependencies = [ 1651 + "proc-macro2", 1652 + "quote", 1653 + "syn", 1654 + "synstructure", 1655 + ] 1656 + 1657 + [[package]] 1658 + name = "zerofrom" 1659 + version = "0.1.6" 1660 + source = "registry+https://github.com/rust-lang/crates.io-index" 1661 + checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" 1662 + dependencies = [ 1663 + "zerofrom-derive", 1664 + ] 1665 + 1666 + [[package]] 1667 + name = "zerofrom-derive" 1668 + version = "0.1.6" 1669 + source = "registry+https://github.com/rust-lang/crates.io-index" 1670 + checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" 1671 + dependencies = [ 1672 + "proc-macro2", 1673 + "quote", 1674 + "syn", 1675 + "synstructure", 1676 + ] 1677 + 1678 + [[package]] 1679 + name = "zeroize" 1680 + version = "1.8.2" 1681 + source = "registry+https://github.com/rust-lang/crates.io-index" 1682 + checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" 1683 + 1684 + [[package]] 1685 + name = "zerotrie" 1686 + version = "0.2.2" 1687 + source = "registry+https://github.com/rust-lang/crates.io-index" 1688 + checksum = "36f0bbd478583f79edad978b407914f61b2972f5af6fa089686016be8f9af595" 1689 + dependencies = [ 1690 + "displaydoc", 1691 + "yoke", 1692 + "zerofrom", 1693 + ] 1694 + 1695 + [[package]] 1696 + name = "zerovec" 1697 + version = "0.11.4" 1698 + source = "registry+https://github.com/rust-lang/crates.io-index" 1699 + checksum = "e7aa2bd55086f1ab526693ecbe444205da57e25f4489879da80635a46d90e73b" 1700 + dependencies = [ 1701 + "yoke", 1702 + "zerofrom", 1703 + "zerovec-derive", 1704 + ] 1705 + 1706 + [[package]] 1707 + name = "zerovec-derive" 1708 + version = "0.11.1" 1709 + source = "registry+https://github.com/rust-lang/crates.io-index" 1710 + checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" 1711 + dependencies = [ 1712 + "proc-macro2", 1713 + "quote", 1714 + "syn", 1715 + ]
+5
Cargo.toml
··· 6 6 [dependencies] 7 7 clap = { version = "4.5.48", features = ["derive"] } 8 8 nom = "8" 9 + reqwest = { version = "0.12", features = ["json", "blocking"] } 10 + serde = { version = "1.0", features = ["derive"] } 11 + serde_json = "1.0" 12 + anyhow = "1.0" 13 + tokio = { version = "1" , features = ["macros", "rt-multi-thread"]}
+1 -3
b.modelfile
··· 1 - # Using llama model yo 2 - FROM llama3.2 3 - MESSAGE user hi 1 + FROM mlx-community/dolphin3.0-llama3.2-1B-4Bit
+1 -1
server/api.py
··· 189 189 190 190 @app.get("/ping") 191 191 async def ping(): 192 - return {"message": "ping"} 192 + return {"message": "Badda-Bing Badda-Bang"} 193 193 194 194 @app.post("/start") 195 195 async def start_model(request: StartRequest):
+6 -3
src/commands/mod.rs
··· 1 1 // Module that handles CLI commands 2 2 3 3 use tiles::{ 4 - core::{health, modelfile}, 4 + core::{ 5 + health, 6 + modelfile::{self}, 7 + }, 5 8 runner::mlx, 6 9 }; 7 10 8 - pub fn run(modelfile: &str) { 11 + pub async fn run(modelfile: &str) { 9 12 match modelfile::parse_from_file(modelfile) { 10 13 Ok(modelfile) => { 11 - mlx::run(modelfile); 14 + mlx::run(modelfile).await; 12 15 } 13 16 Err(err) => println!("{}", err), 14 17 }
+4 -2
src/main.rs
··· 18 18 /// Checks the status of dependencies 19 19 Health, 20 20 } 21 - pub fn main() -> Result<(), Box<dyn Error>> { 21 + 22 + #[tokio::main] 23 + pub async fn main() -> Result<(), Box<dyn Error>> { 22 24 let cli = Cli::parse(); 23 25 match cli.command { 24 26 Commands::Run { modelfile_path } => { 25 - commands::run(modelfile_path.as_str()); 27 + commands::run(modelfile_path.as_str()).await; 26 28 } 27 29 Commands::Health => { 28 30 commands::check_health();
+98 -3
src/runner/mlx.rs
··· 1 - use std::process::Command; 1 + use reqwest::Client; 2 + use serde_json::{Value, json}; 3 + use std::ffi::NulError; 4 + use std::io::Write; 5 + use std::{io, process::Command}; 2 6 3 7 use crate::core::modelfile::Modelfile; 4 8 5 - pub fn run(modelfile: Modelfile) { 6 - // build the arg list from modelfile 9 + pub async fn run(modelfile: Modelfile) { 10 + let model = modelfile.from.as_ref().unwrap(); 11 + if model.starts_with("driaforall/mem-agent") { 12 + let _res = run_model_with_server(modelfile).await; 13 + } else { 14 + run_model_by_sub_process(modelfile); 15 + } 16 + } 7 17 18 + fn run_model_by_sub_process(modelfile: Modelfile) { 19 + // build the arg list from modelfile 8 20 let mut args: Vec<String> = vec![]; 9 21 args.push("--model".to_owned()); 10 22 args.push(modelfile.from.unwrap()); ··· 57 69 eprintln!("❌ Error: Failed to wait for mlx_lm: {}", err); 58 70 } 59 71 } 72 + 73 + async fn run_model_with_server(modelfile: Modelfile) -> reqwest::Result<()> { 74 + // println!("gonna ping"); 75 + // let _ = ping().await; 76 + let stdin = io::stdin(); 77 + let mut stdout = io::stdout(); 78 + // loading the model from mem-agent via daeomn server 79 + let modelname = modelfile.from.as_ref().unwrap(); 80 + load_model(&modelname).await.unwrap(); 81 + println!("Running in interactive mode"); 82 + loop { 83 + print!(">> "); 84 + stdout.flush().unwrap(); 85 + let mut input = String::new(); 86 + stdin.read_line(&mut input).unwrap(); 87 + let input = input.trim(); 88 + match input { 89 + "exit" => { 90 + println!("Exiting interactive mode"); 91 + break; 92 + } 93 + _ => { 94 + if let Ok(response) = chat(input, &modelname).await { 95 + println!(">> {}", response) 96 + } else { 97 + println!(">> failed to respond") 98 + } 99 + } 100 + } 101 + } 102 + Ok(()) 103 + } 104 + 105 + async fn ping() -> reqwest::Result<()> { 106 + let client = Client::new(); 107 + let res = client.get("http://127.0.0.1:6969/ping").send().await?; 108 + println!("{}", res.text().await?); 109 + Ok(()) 110 + } 111 + 112 + async fn load_model(model_name: &str) -> Result<(), String> { 113 + let client = Client::new(); 114 + let body = json!({ 115 + "model": model_name 116 + }); 117 + let res = client 118 + .post("http://127.0.0.1:6969/start") 119 + .json(&body) 120 + .send() 121 + .await 122 + .unwrap(); 123 + // println!("{:?}", res); 124 + if res.status() == 200 { 125 + Ok(()) 126 + } else { 127 + Err(String::from("request failed")) 128 + } 129 + } 130 + 131 + async fn chat(input: &str, model_name: &str) -> Result<String, String> { 132 + let client = Client::new(); 133 + let body = json!({ 134 + "model": model_name, 135 + "messages": [{"role": "user", "content": input}] 136 + }); 137 + let res = client 138 + .post("http://127.0.0.1:6969/v1/chat/completions") 139 + .json(&body) 140 + .send() 141 + .await 142 + .unwrap(); 143 + // println!("{:?}", res); 144 + if res.status() == 200 { 145 + let text = res.text().await.unwrap(); 146 + let v: Value = serde_json::from_str(&text).unwrap(); 147 + let content = v["choices"][0]["message"]["content"] 148 + .as_str() 149 + .unwrap_or("<no content>"); 150 + Ok(content.to_owned()) 151 + } else { 152 + Err(String::from("request failed")) 153 + } 154 + }