Lumaktaw sa nilalaman
Sanggunian para sa Developer

19. Developer Reference

Mga pampublikong kontrata na na-verify sa totoong execution
from Xurcroh import Xurcroh

with Xurcroh(
    cluster={"endpoint": "local://cpu"},
    model_path={"tiny": "/models/tiny"},
) as client:
    response = client.chat.completions.create(
        model="tiny",
        messages=[{"role": "user", "content": "Hello!"}],
    )
    print(response.choices[0].message.content)

Ibabaw ng API

Naglalantad ang Xurcroh at AsyncXurcroh ng .chat.completions.create, .images.generate/.images.edit, at .videos.generate. Kasama sa mga tugon ang mga choice/message/delta, usage, at metadata ng execution. Sakop ng mga parameter ang sampling, max token, streaming, timeout, ID ng cancellation, seed, at mga input na partikular sa modality.

Tumatanggap ang model_path ng isang path o mga pinangalanang depinisyon. Sinusuportahan ng mga cluster worker ang mga endpoint, SSH, metadata ng GPU, label, group, provider, resource, at mga reference sa environment ng credential. Nabibigo bago ang execution, kung posible, ang mga hindi kilalang model at hindi tugmang setting.

Source map at mga error

  • python/Xurcroh: matatag na pampublikong facade.
  • python/xurcroh/runtime: totoong lokal/remote na execution at lifecycle.
  • python/xurcroh/shards: compiler, mga manifest, at mga strict na loader.
  • crates: protocol, crypto, at QUIC.
  • native/cuda: memory at masking.
  • apps/web-manual: independiyenteng dokumentasyon.

Nagmumula sa XurcrohError ang mga error: configuration, paghahanap/pag-load ng model, capability, cluster, protocol, attestation, shard, timeout, cancellation, at saradong client. Walang method na nagbabalik ng simulated na capability kapag hindi available ang isang adapter.

Piliin ang iyong wika

Pantay-pantay ang lahat ng wika. Piliin ang gustong gamitin.

Europa

Gitnang Silangan at Hilagang Aprika

Timog Asya

Timog-Silangang Asya

Silangang Asya

Gitnang Asya at Caucasus

Aprika

Oceania

Likha at Klasikal