Skip to main content

LeRobot policy adapter for NWO Robotics Cloud API

Project description

LeRobot Policy for NWO Robotics

PyPI version License: MIT

Minimal adapter that wraps NWO Robotics Cloud API as a LeRobot-compatible policy.

What This Does

  • Converts LeRobot observations → natural language instructions
  • Calls NWO's Vision-Language-Action (VLA) API
  • Returns actions in LeRobot-compatible format
  • Enables LeRobot users to use NWO as a policy backend

Installation

pip install lerobot_policy_nwo

Quick Start

1. Get API Key

Register at nwo.capital/webapp/api-key.php to get your free API key (100,000 calls/month).

2. Basic Usage

from lerobot_policy_nwo import NWOPolicy, NWOPolicyConfig

# Configure policy
config = NWOPolicyConfig(
    api_key="your_nwo_api_key",  # Or set NWO_API_KEY env var
    instruction_template="Pick up the object",
)

# Create policy
policy = NWOPolicy(config)

# Use in LeRobot loop
observation = {
    "observation.image": camera_frame,  # (3, 224, 224) tensor
    "observation.state": joint_positions,  # (6,) tensor
}

action = policy.select_action(observation)
# Returns: tensor of shape (1, action_dim)

# Check API response metadata
metadata = policy.get_last_metadata()
print(f"Confidence: {metadata['confidence']}")
print(f"Request ID: {metadata['request_id']}")

3. With LeRobot Training

from lerobot.configs.policies import PreTrainedConfig
from lerobot_policy_nwo import NWOPolicy

# Use NWO for data collection
policy = NWOPolicy.from_pretrained("nwo")

# Or specify config
config = PreTrainedConfig.from_pretrained("nwo")
policy = NWOPolicy(config)

Configuration

Parameter Default Description
api_key NWO_API_KEY env Your NWO API key
api_endpoint https://nwo.capital/webapp NWO API base URL
instruction_template "Execute robot action..." Template for converting observations
use_image True Include camera image in API calls
timeout 30.0 API request timeout (seconds)

API Features Used

  • Inference (api-robotics.php?action=inference) - Main VLA inference
  • Health Check (?action=health) - API status
  • Dataset Export (?action=export_dataset) - Export for LeRobot training

Limitations

  • Inference only: NWO does not support training. Use LeRobot's imitation learning on collected data.
  • Cloud-based: Requires internet connection to NWO API
  • Rate limits: Free tier = 100k calls/month, Prototype = 500k/month

Development

git clone https://github.com/nwocapital/lerobot_policy_nwo.git
cd lerobot_policy_nwo
pip install -e ".[dev]"
pytest

Links

License

MIT License - see LICENSE file.

Support

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

lerobot_policy_nwo-0.1.0.tar.gz (12.2 kB view details)

Uploaded Source

Built Distribution

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

lerobot_policy_nwo-0.1.0-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file lerobot_policy_nwo-0.1.0.tar.gz.

File metadata

  • Download URL: lerobot_policy_nwo-0.1.0.tar.gz
  • Upload date:
  • Size: 12.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for lerobot_policy_nwo-0.1.0.tar.gz
Algorithm Hash digest
SHA256 30fea69cc310076d1beeb726e47f68662a918d5dcd62abaad4f82c2d39e718c4
MD5 825f1f62c114bf1b4b8eccce05187379
BLAKE2b-256 62596287d55c95287aab161b71c5d49eec002dba0fe77fc203930657c44d261f

See more details on using hashes here.

File details

Details for the file lerobot_policy_nwo-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for lerobot_policy_nwo-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b3126cbbe35a3e4af97de1a18e3230e14750129fc9eadb1ed8e6f87c6f087298
MD5 77d2decb3bfcf02929abd74994aa43d8
BLAKE2b-256 09ce0b669ec7d9b2f894d5988270299473e969eaddd2b6e1a430a1857358f337

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