Skip to main content

Examples

The SDK repo ships a set of runnable example scripts under audio/examples/ and ssh/examples/. Each one is small (50–150 lines) and intentionally focused on one idea.

Source: github.com/autonomous-ai/intern-developer-sdk

Audio examples

diagnostic.py

Runs the full AudioSDK.health_check() flow — initialize codec, play a tone, record it, check RMS — and exits with a status code. Use this in CI or as a smoke test after Deploy to Device.

python3 audio/examples/diagnostic.py
echo $? # 0 = healthy, 1 = degraded

record_play.py

Records 5 seconds from the mic and plays it back. The "hello, audio works" demo.

python3 audio/examples/record_play.py
# speaks for 5s after the countdown

Reads from card 1 by default (the ES8389). Edit the card= argument to switch.

live_passthrough.py

Streams the mic to the speaker live, with the feedback-safe gate enabled. Run it on the device (not your laptop) for the intended demo:

ssh system@172.168.20.145 "python3 ~/sdk/audio/examples/live_passthrough.py"

Talk into the mic; you hear yourself in the speaker. Press Ctrl-C to stop.

SSH examples

run_command.py

The smallest possible SSH SDK demo — connect, run one command, print stdout/stderr.

python3 ssh/examples/run_command.py \
--host 172.168.20.145 --user system --password '...' \
--cmd 'uptime'

push_pull_files.py

Pushes a local file to the device and pulls it back, validating bytes match. Useful for first-time validation of paramiko install and credentials.

python3 ssh/examples/push_pull_files.py \
--host 172.168.20.145 --user system --key ~/.ssh/id_ed25519

deploy_audio_sdk.py

Orchestrates a full audio SDK deploy: copies audio_sdk.py over, installs python3-pyaudio, adds system to audio group, then runs the diagnostic. Essentially the manual version of onboard_device.py — read it if you want to see exactly what the onboarding script does.

python3 ssh/examples/deploy_audio_sdk.py \
--host 172.168.20.145 --user system --key ~/.ssh/id_ed25519

Building from these examples

The examples are written to be copied. Typical workflow:

  1. Find the example closest to what you want.
  2. Copy it into your own project under a new name.
  3. Replace the AudioSDK(...) / InternSSH(...) line with your own values.
  4. Wire it into whatever (a CLI, a Flask endpoint, a systemd service).

Both SDKs are pure Python and have no licensing restriction inside the repo — see the LICENSE file for terms.

Want more examples?

Open an issue or PR at autonomous-ai/intern-developer-sdk with the use case you'd like to see demonstrated.