19. Ìtọ́kasí Olùgbéjáde
Àwọn àdéhùn gbangba tí a ti fìdí wọn múlẹ̀ nípasẹ̀ ìṣiṣẹ́ gidifrom 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)
Ojú àwọn API
Xurcroh àti AsyncXurcroh ń fi .chat.completions.create, .images.generate/.images.edit àti .videos.generate hàn. Àwọn ìdáhùn ní choices/messages/deltas, usage àti metadata ìṣiṣẹ́. Àwọn paramita bo sampling, max tokens, streaming, timeout, ID ìfagilé, seed àti àwọn ìwọlé tí ó jẹ́ ti modality pàtó.
model_path ń gba ọ̀nà kan tàbí àwọn ìtumọ̀ tí a sọ lórúkọ. Àwọn worker cluster ń ṣe àtìlẹ́yìn fún àwọn endpoint, SSH, metadata GPU, àwọn label, àwọn ẹgbẹ́, àwọn olùpèsè, àwọn ohun èlò àti àwọn ìtọ́kasí àyíká ẹ̀rí. Àwọn model tí a kò mọ̀ àti àwọn ètò tí kò báramu ń kùnà kí ìṣiṣẹ́ tó bẹ̀rẹ̀ níbi tí ó bá ṣeéṣe.
Àwòrán orísun àti àwọn àṣìṣe
python/Xurcroh: facade gbangba tí ó dúró ṣinṣin.python/xurcroh/runtime: ìṣiṣẹ́ àdúgbò/jíjìnnà gidi àti ayé iṣẹ́.python/xurcroh/shards: compiler, àwọn manifest àti àwọn loader líle.crates: protocol, crypto àti QUIC.native/cuda: ìrántí àti ìbòmọ́lẹ̀.apps/web-manual: ìwé àkọsílẹ̀ òmìnira.
Àwọn àṣìṣe ń wá láti XurcrohError: ìṣètò, wíwá/ìgbé model, agbára, cluster, protocol, attestation, shard, timeout, ìfagilé àti client tí a ti tì. Kò sí ọ̀nà kankan tí ó ń dá agbára àfarawé padà nígbà tí adapter kò bá sí.