Skip to content

feat: Python SDK stub for one-line ML framework integration#2

Merged
joelpeace48-cell merged 1 commit into
mainfrom
feat/python-sdk-v2
May 18, 2026
Merged

feat: Python SDK stub for one-line ML framework integration#2
joelpeace48-cell merged 1 commit into
mainfrom
feat/python-sdk-v2

Conversation

@joelpeace48-cell
Copy link
Copy Markdown

Summary

Adds the ModelTraceClient Python SDK stub, enabling ML engineers to integrate ModelTrace into existing training and inference pipelines with minimal code changes.

API Design

from modeltrace import ModelTraceClient

client = ModelTraceClient(
    rpc_url="https://soroban-testnet.stellar.org",
    secret_key="S...",
    contract_id="C..."
)

model_id = client.register_model(
    name="MyLLM-v1",
    version="1.0.0",
    weights_hash="sha256:abc123...",
    training_data_cid="QmXzY7bN9..."
)

event_id = client.log_inference(
    model_id=model_id,
    payload_hash="sha256:def456...",
    risk_level="LOW"
)

What's included

  • ModelTraceClient class with fully typed method signatures
  • ModelRecord, AuditEvent, RegistryStats dataclass stubs
  • RiskLevel literal type for type-safe risk classification
  • Documented integration points for stellar-sdk Soroban transaction builder
  • Explicit NotImplementedError with helpful guidance (not silent failures)

What's next

  • Implement Soroban transaction builder in register_model()
  • Implement log_inference() with async support
  • PyPI package modeltrace-sdk
  • MLflow autolog integration
  • Hugging Face Hub hook

Test plan

  • Unit tests pending stellar-sdk integration
  • Integration test against testnet deployment

Related: #14 (Python SDK milestone)

Adds modeltrace Python SDK scaffolding with ModelTraceClient class,
type stubs for ModelRecord/AuditEvent/RegistryStats, and documented
integration points for stellar-sdk.
@joelpeace48-cell joelpeace48-cell merged commit e25115c into main May 18, 2026
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant