मुख्य सामग्री पर जाएं
प्रशिक्षण मार्गदर्शिका के अध्याय सभी दस्तावेज़

प्रशिक्षण API संदर्भ

पंजीकृत एंडपॉइंट, अनुरोध का मुख्य भाग, जवाब, स्वामित्व की सीमाएँ और त्रुटि-प्रबंधन।

प्रशिक्षण मार्गदर्शिका के अध्याय

हर भाषा में कमांड और कोड अंग्रेज़ी में ही रहेंगे। बड़े अक्षरों वाले प्लेसहोल्डर को अपने खाते और भुगतान किए गए कार्य के मानों से बदलें; साझा नोटबुक या लॉग में असली कुंजियाँ न डालें।

API संसाधनों का जीवनचक्र

कोट, भुगतान किया गया जॉब और ट्रेनिंग सत्र अलग-अलग संसाधन हैं।
  1. कोट कॉन्फ़िगरेशन और मौजूदा कीमत की पुष्टि करें
  2. जॉब स्वीकृत भुगतान बनाएँ और पूरा करें
  3. सत्र निष्पादन परिवेश और शामिल संदर्भ चुनें
  4. तैयारी सत्यापित आँकड़ा-संग्रह के घोषणापत्र बनाएँ
  5. रिपोर्ट असली ट्रेनिंग और मॉडल फ़ाइलों का विवरण दर्ज करें

कोट: कॉन्फ़िगरेशन और मौजूदा कीमत की पुष्टि करें. जॉब: स्वीकृत भुगतान बनाएँ और पूरा करें. सत्र: निष्पादन परिवेश और शामिल संदर्भ चुनें. तैयारी: सत्यापित आँकड़ा-संग्रह के घोषणापत्र बनाएँ. रिपोर्ट: असली ट्रेनिंग और मॉडल फ़ाइलों का विवरण दर्ज करें

प्रमाणीकरण और अनुरोध के नियम

ai:training दायरे वाली खाते की API कुंजी के साथ HTTPS और Authorization: Bearer इस्तेमाल करें। Accept: application/json भेजें; JSON मुख्य भाग के लिए Content-Type: application/json जोड़ें। सभी संसाधन खाते के स्वामित्व में हैं। मार्ग-समूह पर प्रति मिनट 30 अनुरोधों की सीमा है और जहाँ कॉन्फ़िगरेशन हो वहाँ अतिरिक्त नियंत्रण भी लागू हैं। उदाहरणों में पहचान-संख्याएँ केवल प्लेसहोल्डर हैं, साझा संसाधन नहीं।

  • कोट, जॉब, सत्र, मॉडल और मॉडल फ़ाइलों की पहचान-संख्याएँ अलग-अलग होती हैं।
  • नेटवर्क रुकने के बाद लिखने का अनुरोध दोहराने से पहले मौजूदा स्थिति पढ़ें।
  • API अनुरोधों में सार्वजनिक पृष्ठों की भाषा या कीमत से जुड़े क्वेरी पैरामीटर इस्तेमाल न करें।
उदाहरण · bash
export TRAINING_API='https://fusionpointai.com/api/v1/training'
# Set the key securely as shown in Quickstart.
export JOB_UUID='REPLACE_WITH_YOUR_JOB_UUID'
export SESSION_ID='REPLACE_WITH_YOUR_SESSION_ID'
curl --fail-with-body --silent --show-error "$TRAINING_API/jobs" \
  -H "Authorization: Bearer $FUSIONPOINTAI_API_KEY" -H 'Accept: application/json'

अनुरोध, जवाब और संसाधनों की स्थिति

पात्र कॉन्फ़िगरेशन से मूल्य-प्रस्ताव बनाएँ, उससे मूल प्रशिक्षण कार्य बनाएँ और सत्र खोलने से पहले स्वीकृत भुगतान प्रक्रिया पूरी करें। प्रोजेक्ट के एंडपॉइंट पहले से सशुल्क संदर्भ-मॉडल तक पहुँच की पुष्टि करते हैं। वे बिल बनाए या भुगतान बदले बिना पाठ्यक्रम या पाठ माँगते हैं। सत्र के जवाब में कॉन्फ़िगरेशन, चुना हुआ संदर्भ मॉडल, डेटा मैनिफ़ेस्ट, बताई गई प्रगति और रिपोर्ट शामिल होती हैं। तैयारी और रिपोर्ट भेजना अलग अनुरोध हैं; काम और सत्र की स्थितियाँ भी अलग रहती हैं।

  • प्रोजेक्ट की अनुमति जाँचने के लिए सेवा-प्रदाता और reference_model_id चाहिए; शिक्षक से अनुरोध में action और objective भी दें।
  • शिक्षक को केवल स्वीकृत ट्रेनिंग सामग्री भेजें; वैलिडेशन और फ़ाइनल टेस्ट की पंक्तियाँ स्थानीय रखें।
  • पुरानी पूर्णता-रिपोर्ट असली स्थानीय आउटपुट बताए और अखंडता तथा मूल्यांकन की जाँच पास करे।
उदाहरण · text
POST /api/v1/training/quotes
reference_model_id     required eligible integer model ID
training_plan_id       required public provider-plan integer ID
mode                   automatic | advanced
objective              required string, 10..4000 characters
language               required string, at most 120 characters
performance_criteria   required string, 10..2000 characters
student_release_slug   optional eligible slug, at most 190 characters
method                 optional eligible method, at most 80 characters
dataset_megabytes      optional integer, 1..1000000
gpu_count              optional integer, 1..128
delivery               optional: artifact | hosted
execution_target       optional: fusionpointai_hosting | customer_datacenter | colab

Availability and approved plan policies can impose narrower constraints.
Do not submit price, fixed_total, currency, price_version_id or model_training.
उदाहरण · json
{
  "reference_model_id": 123,
  "training_plan_id": "<INTEGER_FROM_YOUR_PROVIDER_PLAN>",
  "mode": "advanced",
  "objective": "Train a German support-message classifier.",
  "language": "German",
  "performance_criteria": "Evaluate per-class precision and recall on held-out data.",
  "student_release_slug": "<ELIGIBLE_STUDENT_RELEASE_SLUG>",
  "method": "LoRA",
  "dataset_megabytes": 8,
  "gpu_count": 1,
  "delivery": "artifact"
}
उदाहरण · bash
# Save the body as quote.json; replace ID placeholders with integers.
# Automatic mode omits student_release_slug and method.
curl --fail-with-body --silent --show-error "$TRAINING_API/quotes" \
  -H "Authorization: Bearer $FUSIONPOINTAI_API_KEY" \
  -H 'Accept: application/json' -H 'Content-Type: application/json' \
  --data-binary @quote.json
# Save {"quote":"YOUR_QUOTE_UUID"} as job.json.
# Creates a native job/invoice; this is not payment confirmation.
curl --fail-with-body --silent --show-error "$TRAINING_API/jobs" \
  -H "Authorization: Bearer $FUSIONPOINTAI_API_KEY" \
  -H 'Accept: application/json' -H 'Content-Type: application/json' \
  --data-binary @job.json
curl --fail-with-body --silent --show-error "$TRAINING_API/jobs/$JOB_UUID" \
  -H "Authorization: Bearer $FUSIONPOINTAI_API_KEY" -H 'Accept: application/json'
उदाहरण · text
POST /api/v1/training/quotes: 201
{quote: UUID, currency: ISO_CODE, fixed_total: DECIMAL_STRING, expires_at: ISO_8601}

POST /api/v1/training/jobs: {"quote":"OWNED_QUOTE_UUID"}
201 for a newly created job; 200 when an accepted quote reuses its job.
Job fields:
id                job UUID
status            native job state, such as awaiting_payment
progress_percent  recorded progress, not an independent quality score
invoice_id        owned native invoice ID or null
created_at        ISO 8601 timestamp
completed_at      ISO 8601 timestamp or null
training_session  null or {id, status, step, delivery, verification}

GET /api/v1/training/jobs:
{data: JOB_ARRAY, current_page: INTEGER, last_page: INTEGER, per_page: 50, total: INTEGER}

This is a response-shape reference, not a fabricated live response.
उदाहरण · bash
# Save as session.json, using your paid job UUID and optional reference ID:
# {"job":"YOUR_PAID_JOB_UUID","runtime":"customer_datacenter","reference_model_id":123}
curl --fail-with-body --silent --show-error "$TRAINING_API/sessions" \
  -H "Authorization: Bearer $FUSIONPOINTAI_API_KEY" \
  -H 'Accept: application/json' -H 'Content-Type: application/json' \
  --data-binary @session.json
curl --fail-with-body --silent --show-error "$TRAINING_API/sessions/$SESSION_ID" \
  -H "Authorization: Bearer $FUSIONPOINTAI_API_KEY" -H 'Accept: application/json'
# One preparation batch; inspect progress before another request.
curl --fail-with-body --silent --show-error "$TRAINING_API/sessions/$SESSION_ID/prepare" \
  -H "Authorization: Bearer $FUSIONPOINTAI_API_KEY" \
  -H 'Accept: application/json' -H 'Content-Type: application/json' --data '{}'
उदाहरण · text
Session response fields (shape reference, not a fabricated live result):
id                  session UUID
job                 owned job UUID
status              preparing | ready | running | evaluating | completed | failed | cancelled
configuration       approved method, student_checkpoint, sdk_training and selected reference
reference_model_id  selected integer reference ID
expires_at          ISO 8601 access expiry
step                last reported integer step
datasets[]          {split, rows, bytes, sha256}
report              current report object; event metrics live under report.last_event.metrics
delivery            runtime_local
verification        runtime_reported
उदाहरण · bash
curl --fail-with-body --silent --show-error \
  "$TRAINING_API/sessions/$SESSION_ID/datasets/train" \
  -H "Authorization: Bearer $FUSIONPOINTAI_API_KEY" \
  -H 'Accept: application/x-ndjson' --output train.jsonl
# Use /datasets/validation for the other supported split.
sha256sum train.jsonl
# Compare bytes, rows and SHA-256 with the session manifest.
# For published server-side artifacts only, not the local SDK ZIP:
# GET /api/v1/training/jobs/{job}/artifacts/{file}
उदाहरण · text
POST /api/v1/training/sessions/{session}/events
Content-Type: application/json

state         required: running | evaluating | failed
step          required integer: 0..2000
total_steps   required integer: 1..2000
metrics       optional; only loss and eval_loss, each 0..1000000
error_code    optional: training_failed | evaluation_failed | runtime_unavailable |
              dataset_invalid | report_failed

Send actual trainer observations, never sample or invented metrics.
उदाहरण · bash
# Build the body from a REAL SDK report; requires jq.
jq '{artifact_name:"model-package.zip",report:.completion_report}' \
  customer-model-run-001/training-report.json > completion.json
curl --fail-with-body --silent --show-error "$TRAINING_API/sessions/$SESSION_ID/complete" \
  -H "Authorization: Bearer $FUSIONPOINTAI_API_KEY" \
  -H 'Accept: application/json' -H 'Content-Type: application/json' \
  --data-binary @completion.json
# Cancel eligible service state, not the operating-system process:
curl --fail-with-body --silent --show-error "$TRAINING_API/sessions/$SESSION_ID/cancel" \
  -H "Authorization: Bearer $FUSIONPOINTAI_API_KEY" \
  -H 'Accept: application/json' -H 'Content-Type: application/json' --data '{}'
उदाहरण · bash
curl --fail-with-body --silent --show-error \
  'https://fusionpointai.com/api/v1/training/projects/authorize' \
  -H "Authorization: Bearer $FUSIONPOINTAI_API_KEY" \
  -H 'Accept: application/json' -H 'Content-Type: application/json' \
  --data '{"provider":"openai","reference_model_id":123}'
# The response identifies the owned paid job/grant and access expiry.
उदाहरण · bash
curl --fail-with-body --silent --show-error \
  'https://fusionpointai.com/api/v1/training/projects/teacher' \
  -H "Authorization: Bearer $FUSIONPOINTAI_API_KEY" \
  -H 'Accept: application/json' -H 'Content-Type: application/json' \
  --data '{"provider":"openai","reference_model_id":123,"action":"lessons","objective":"Classify support messages into agreed categories.","topic":"ambiguous_requests","count":2,"approved_examples":["A reviewed support training example."]}'
# Send only explicitly approved training examples. Never send held-out rows.
# Curriculum action returns topics; lessons action returns text/topic examples.
उदाहरण · python
import os
from fusionpointai_training import TrainingClient

client = TrainingClient(api_key=os.environ["FUSIONPOINTAI_API_KEY"])
session = client.get_session(os.environ["FUSIONPOINTAI_SESSION_ID"])
print("Session:", session["id"])
print("Status:", session["status"])
print("Last reported step:", session["step"])
# Inspection is read-only; status and step are server-reported state.
उदाहरण · python
import os
from fusionpointai_training import TrainingClient

client = TrainingClient(api_key=os.environ["FUSIONPOINTAI_API_KEY"])
session = client.get_session(os.environ["FUSIONPOINTAI_SESSION_ID"])
for manifest in session["datasets"]:
    print(
        manifest["split"],
        "rows:", manifest["rows"],
        "bytes:", manifest["bytes"],
        "sha256:", manifest["sha256"],
    )
# These are server-provided manifest values, not a local integrity pass.
उदाहरण · python
import os
from fusionpointai_training import TrainingClient

client = TrainingClient(api_key=os.environ["FUSIONPOINTAI_API_KEY"])
session = client.get_session(os.environ["FUSIONPOINTAI_SESSION_ID"])
server_report = session.get("report")
runtime_report = server_report.get("runtime") if isinstance(server_report, dict) else None
if (
    session.get("status") == "completed"
    and isinstance(runtime_report, dict)
    and runtime_report.get("artifact_sha256") == os.environ["LOCAL_ARTIFACT_SHA256"]
    and server_report.get("delivery") == "runtime_local"
    and server_report.get("verification") == "runtime_reported"
):
    print("Server report matches the local artifact digest.")
else:
    print("Completion is not confirmed for this local artifact.")
# Reconcile by reading state; do not repeat training or invent a result.

त्रुटियाँ और सुरक्षित एकीकरण

हर त्रुटि को अस्थायी मानने के बजाय HTTP स्थिति और लौटे जाँच-विवरण देखें। बिना प्रमाणीकरण वाले अनुरोध पर 401, अस्वीकृत पहुँच पर 403, अनुपस्थित या दूसरे खाते के संसाधन पर 404, असंगत स्थिति पर 409, अमान्य जानकारी पर 422 और अनुरोध-सीमा पार होने पर 429 अपेक्षित हैं। सेवा-प्रदाता या निष्पादन परिवेश की विफलताएँ अन्य त्रुटियाँ लौटा सकती हैं। SDK APIError देता है, लेकिन गोपनीय जानकारी वाले बाहरी जवाब का कच्चा रूप नहीं लौटाता।

  • घटनाओं में running, evaluating या failed मान्य हैं; मापों की कुंजियाँ loss और eval_loss हैं।
  • step और total_steps की सीमा 2000 है; total_steps धनात्मक होना चाहिए।
  • समापन अनुरोध के मुख्य भाग में artifact_name और उदाहरण में दिखाए गए रिपोर्ट के सभी फ़ील्ड चाहिए।
उदाहरण · text
401  Authentication missing or invalid
403  Account/key scope or access denied
404  Resource missing, non-owned or intentionally hidden
409  Invalid session transition, runtime, paid-access or model configuration
410  Writable session expired
422  Invalid request fields or completion criteria not met
429  Request rate limited
502  Upstream reference data malformed or preparation failed

Do not retry a write blindly. Read session state and inspect the response.
Keep error_code distinct from the HTTP status. Never log authorization.
उदाहरण · text
POST /api/v1/training/sessions/{session}/complete
artifact_name                 safe filename ending in .zip, max 160 characters
report.training_steps         integer 1..2000
report.weights_before_sha256  lowercase SHA-256 of actual pre-training weights
report.weights_after_sha256   lowercase SHA-256 of actual changed weights
report.artifact_sha256        lowercase SHA-256 of the real local ZIP
report.artifact_bytes         integer 1..107374182400
report.eval_loss_before       finite number >0 and <=1000000
report.eval_loss_after        finite number >=0 and <=1000000
report.base_repository        pinned student repository, max 255 characters
report.base_revision          lowercase immutable 40-character revision
report.method                 SFT | LoRA | QLoRA

Values must match the approved session and actual local training.
Additional report keys are rejected. This body does not upload the ZIP.
उदाहरण · python
import os
from fusionpointai_training import TrainingClient
from fusionpointai_training.errors import APIError

client = TrainingClient(
    api_key=os.environ["FUSIONPOINTAI_API_KEY"],
    timeout=30.0,
    max_get_retries=2,
)
try:
    session = client.get_session(os.environ["FUSIONPOINTAI_SESSION_ID"])
except APIError:
    # GET retries are bounded. Do not blindly retry a write after an error.
    print("Session inspection failed; check access and current server state.")
else:
    print("Status:", session["status"])
# Never print the API key, authorization headers, or response secrets.

API संदर्भ

एंडपॉइंटउद्देश्य और व्यवहार
POST /api/v1/training/quotes Authorization: Bearer ai:training पात्र संदर्भ, योजना और विन्यास की पुष्टि करें; जवाब में मूल्य-प्रस्ताव का UUID, मुद्रा, fixed_total और expires_at मिलता है। स्वीकृत योजना और विद्यार्थी मॉडल की पात्र सेटिंग इस्तेमाल करें, क्लाइंट की मनमानी कीमतें नहीं।
GET /api/v1/training/jobs Authorization: Bearer ai:training प्रमाणित ग्राहक के कार्यों की सूची देखें। संख्यात्मक पहचान-संख्या का अनुमान लगाने के बजाय मिली सूची और संसाधनों की पहचान-संख्या देखें।
POST /api/v1/training/jobs Authorization: Bearer ai:training मान्य मूल्य-प्रस्ताव के UUID से खाते के स्वामित्व वाला कार्य बनाएँ। जवाब में कार्य की पहचान-संख्या, स्थिति, चालान की पहचान-संख्या और समय की जानकारी मिलती है; कार्य बनना भुगतान का प्रमाण नहीं है।
GET /api/v1/training/jobs/{job} Authorization: Bearer ai:training कार्य के UUID से अपना काम देखें; इसमें उसकी ताज़ा प्रगति और फ़ाइल डिलीवरी की स्थिति शामिल है।
GET /api/v1/training/jobs/{job}/artifacts/{file} Authorization: Bearer ai:training इस कार्य से जुड़ी प्रकाशित फ़ाइल डाउनलोड करें। स्थानीय SDK ZIP अपने आप अपलोड नहीं होती और इस मार्ग से उपलब्ध नहीं होती।
POST /api/v1/training/sessions Authorization: Bearer ai:training अनुरोध के मुख्य भाग में कार्य का UUID, runtime और वैकल्पिक धनात्मक reference_model_id दें। नया या दोबारा इस्तेमाल किया गया सत्र लौटाया जाता है; संदर्भ केवल तैयारी शुरू होने से पहले बदला जा सकता है।
GET /api/v1/training/sessions/{session} Authorization: Bearer ai:training अपने सत्र का विन्यास, आँकड़ा-संग्रह, रिपोर्ट और स्थिति पढ़ें। स्थिति पढ़ने से प्रशिक्षण शुरू नहीं होता।
POST /api/v1/training/sessions/{session}/prepare Authorization: Bearer ai:training सीमित तैयारी-समूह माँगने के लिए खाली JSON ऑब्जेक्ट भेजें। अनुरोध-सीमा के भीतर, प्रगति होती रहे तो तैयारी पूरी होने तक इसे दोहराएँ।
GET /api/v1/training/sessions/{session}/datasets/{split} Authorization: Bearer ai:training train या validation को application/x-ndjson के रूप में डाउनलोड करें। बाइट, SHA-256 और पंक्तियों की संख्या उसी सत्र के घोषणापत्र से मिलाएँ।
POST /api/v1/training/sessions/{session}/events Authorization: Bearer ai:training वास्तविक स्थिति, step, total_steps और वैकल्पिक माप loss/eval_loss भेजें। केवल समर्थित स्थिति और त्रुटि-कोड इस्तेमाल करें।
POST /api/v1/training/sessions/{session}/complete Authorization: Bearer ai:training artifact_name और पूरी वास्तविक प्रशिक्षण रिपोर्ट भेजें। सेवा प्रशिक्षण-विधि, आधार संशोधन, भारों में बदलाव, फ़ाइल का हैश और मूल्यांकन मानदंड जाँचती है।
POST /api/v1/training/sessions/{session}/cancel Authorization: Bearer ai:training रद्द की जा सकने वाली सेवा-स्थिति के लिए खाली JSON ऑब्जेक्ट भेजें। ज़रूरत पड़ने पर अलग GPU प्रक्रिया स्वयं रोकें; यह pause/resume नहीं है।
POST /api/v1/training/projects/authorize Authorization: Bearer ai:training provider और धनात्मक reference_model_id के साथ POST /api/v1/training/projects/authorize भेजें। यह प्रमाणित खाते की सशुल्क संदर्भ-मॉडल पहुँच फिर जाँचता है और उसी खाते के काम की पहचान, grant, सेवा-प्रदाता, संदर्भ मॉडल तथा पहुँच की समय-सीमा लौटाता है। इससे बिल नहीं बनता और भुगतान में बदलाव नहीं होता।
POST /api/v1/training/projects/teacher Authorization: Bearer ai:training provider, reference_model_id, action (curriculum या lessons), objective, वैकल्पिक topic, count (1–4) और अधिकतम आठ approved_examples (हर एक अधिकतम 2,000 अक्षर) के साथ POST /api/v1/training/projects/teacher भेजें। जवाब में विषयों की सूची या पाठों के टेक्स्ट और विषय वाली पंक्तियाँ मिलती हैं। केवल स्वीकृत ट्रेनिंग सामग्री भेजें; वैलिडेशन या फ़ाइनल टेस्ट का डेटा कभी न भेजें।