Skip to main content

The official Python SDK for DustyLM: an 8M-parameter model that talks like a robot vacuum.

Project description

DustyLM Logo

dustylm-sdk

Run DustyLM, the 8M parameter robot vacuum language model, in a few lines.

pip install dustylm-sdk
from dustylm_sdk import DustyLM
model = DustyLM.from_pretrained("mkhordoo/dusty-8m-sft")
response = model.chat([{"role": "user", "content": "who are you?"}])
print(response["choices"][0]["message"]["content"])

# beep. i am a little robot. i clean floors and find crumbs.

Backends

Backend Install Model file Best for
torch (default) pip install dustylm-sdk ~32 MB (FP32) Inspection and experimentation
onnx pip install dustylm-sdk[onnx] ~8–10 MB (int8) A compact model artifact

These sizes describe the model files, not the complete Python environment. Installation size varies by platform. Both backends currently include PyTorch as an SDK dependency.

# ONNX backend
model = DustyLM.from_pretrained("mkhordoo/dusty-8m-sft", backend="onnx")

Loading Local Checkpoints

Pass a Hugging Face repository ID to download its model and tokenizer automatically, as shown in the quick-start example:

model = DustyLM.from_pretrained("mkhordoo/dusty-8m-sft")

For files already downloaded to your machine, pass their local directory instead. With the default filenames, that directory must contain tokenizer.json and either model.pt (PyTorch) or model_int8.onnx (ONNX):

model = DustyLM.from_pretrained("./my-checkpoint/")

You can use any local directory as the artifact root. model_file and tokenizer_file are resolved relative to that directory, so they may use different filenames or relative paths.

If you trained a model with the main dusty-lm repository, its checkpoint and tokenizer are stored in separate artifact directories. Load the promoted SFT checkpoint with:

from dustylm_sdk import DustyLM

model = DustyLM.from_pretrained(
    "artifacts/checkpoints",
    model_file="dusty8m_sft.pt",
    tokenizer_file="../tokenizers/dusty_tokenizer.json",
)

response = model.chat([{"role": "user", "content": "who are you?"}])

To inspect an intermediate checkpoint instead, change model_file to an existing step file such as dusty8m_sft_step_100.pt.

The SDK infers several architecture dimensions from PyTorch checkpoint shapes and currently expects DustyLM-compatible configurations.

API

DustyLM.from_pretrained

DustyLM.from_pretrained(
    repo_id_or_path: str = "mkhordoo/dusty-8m-sft",
    *,
    model_file: str | None = None,
    tokenizer_file: str | None = None,
    backend: str = "torch",
)
Argument Default Description
repo_id_or_path "mkhordoo/dusty-8m-sft" HF Hub repo ID or local directory path
model_file "model.pt" (torch) / "model_int8.onnx" (onnx) Override the model filename in the directory
tokenizer_file "tokenizer.json" Override the tokenizer filename
backend "torch" "torch" or "onnx"

DustyLM.chat

model.chat(
    messages: list[dict],
    temperature: float = 0.7,
    max_tokens: int = 64,
    top_p: float = 0.9,
) -> dict

Returns an OpenAI-style chat completion dict.


Built from the dusty-lm training repository.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dustylm_sdk-0.1.2.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dustylm_sdk-0.1.2-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file dustylm_sdk-0.1.2.tar.gz.

File metadata

  • Download URL: dustylm_sdk-0.1.2.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for dustylm_sdk-0.1.2.tar.gz
Algorithm Hash digest
SHA256 3f8e6f29a3ba3c8e3690984715e93a4516cf447c9e11de0f29402d2171592496
MD5 6149417023999445a957641bcf8d5078
BLAKE2b-256 607f89e0f72bc0ba7faa75b60643a7461c60f92edccbe492e47afdc6ed61793c

See more details on using hashes here.

File details

Details for the file dustylm_sdk-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: dustylm_sdk-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for dustylm_sdk-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7589c7cde7d22de2b64d4063c4a5a250c71f54a45dca45e7177274a49ab8bff5
MD5 f4cc20669c356af670cb25217ff8ec90
BLAKE2b-256 d2f23399e0a90e65a8ea070034a6ef75246c306c5a36cb5a0c11abda536e7cab

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page