Run the Skylark SDK on this machine
Install the Skylark SDK from the Hub and call Skylark's detection models from your own code on this machine, with the same API and clients as the cloud SDK and nothing leaving the machine.
The Skylark SDK is a REST API over Skylark's detection models. Normally you call it
in the cloud, at https://sdk.skylarklabs.ai/v1, with an API key from the console. With the
Hub you can run the same API on a machine of your own: a Jetson, a Linux or Windows
workstation with an NVIDIA GPU, or a Hailo box. Your code calls http://127.0.0.1:8092/v1 instead. The models,
the calls, the clients and the results are the same, and no frame leaves the machine.
It runs on the Kepler AI service the Hub installed on that machine, so there is nothing new to license: the machine's organization license key is the SDK's API key.
Which SDK is for you
| Cloud SDK | SDK on this machine (this page) | Skylark Edge | |
|---|---|---|---|
| Where the model runs | Skylark's servers | Your Jetson, workstation or Hailo box | Your machine, inside your Python process |
| How you call it | REST, any language | REST, any language, same clients | Python package |
| Key | skl_… API key from the console | Your organization's license key | Your organization's license key |
| Billing | Per frame | Nothing is metered | Nothing is metered |
| Needs | Internet | Kepler AI installed by the Hub; internet when it starts | A model downloaded once |
| Live cameras | Yes | Yes, cameras on your network | No |
Pick the SDK on this machine when you already run Kepler AI on site and want to call its models from other software on that machine or on the same network, without sending video to the cloud and without a per-frame cost.
How it works
When you start the SDK, the Hub starts it in the background (on Linux, as a service named
kepler-ai-sdk). It:
- finds the Kepler AI package the Hub installed (Jetson, Workstation or Hailo);
- pauses Kepler's own AI service (on Windows, the Kepler AI tray app), so the models are loaded only once and the accelerator is not shared;
- runs that package's SDK server, which fetches and decrypts the SDK's models with the machine's license key, the same way Kepler AI fetches its own;
- serves the SDK API on
127.0.0.1:8092, checking that every call carries the organization license key.
Stop reverses all of it: if Kepler's AI service was running before, it is started again (if it was stopped, it stays stopped). The SDK is never started on its own: after a restart of the machine it is off and Kepler AI is back, until you start it again.
One machine runs the SDK or Kepler AI, not both
While the SDK runs, Kepler on that machine has no AI: no detections and no smart alerts. Use a machine dedicated to the SDK, or stop the SDK when Kepler needs its AI back.
Before you start
Check these five things. Each one is something the SDK refuses to start without.
The SDK runs on Linux (Ubuntu 20.04 or newer, including JetPack 5 and 6), on x64 or arm64, and on Windows 10 or 11 (x64) through the desktop Hub. It needs the hardware Kepler AI needs:
| Machine | Kepler AI build | Notes |
|---|---|---|
| NVIDIA Jetson Orin | Kepler Jetson AI | arm64; managed with hubctl, there is no desktop Hub for Jetson |
| PC or server with an NVIDIA GPU | Kepler Workstation AI | NVIDIA driver 525 or newer; Linux or Windows |
| PC with a Hailo-8 card | Kepler Hailo AI | HailoRT installed; Linux or Windows |
There is no CPU-only build. See Hardware and AI profiles for how the Hub picks the build, and plan for the SDK's models on disk and in accelerator memory (a few gigabytes each).
The SDK needs the machine activated with your organization's license key: it uses
the key to fetch its models from Skylark Central, and your code sends the same key as
the API key. Activation writes the key to /etc/skylark/license.json
(%ProgramData%\Skylark\license.json on Windows), the file every Skylark product on the
machine shares. See Activation.
This is the long organization key (64 letters and digits), the one in the
install-and-activate command under the Skylark Hub menu in
Skylark Central and under your organization's
settings. The shorter XXXXX-XXXXX-XXXXX-XXXXX keys listed per license, and skl_…
keys from the SDK console, don't activate a device and don't work as the API key here.
If you can't see the organization key, ask your organization's admin or Skylark.
Signing in to the desktop Hub with an account does not activate the machine. Run
sudo hubctl activate <org-key> on it (Linux), or install Kepler AI from the Hub after
signing in with the License key tab, which writes the file on that first install
(the only way on Windows).
The SDK runs the SDK server that ships inside Kepler AI from version 1.1. The Hub
installs it: from the Library on a desktop, or sudo hubctl install ai. Kepler AI only
needs to be installed, not running. An older Kepler AI makes the start fail with
has no SDK server; update it first (Update in the Library, or
sudo hubctl update --yes).
Images need nothing extra. Video files and camera streams are decoded with ffmpeg.
On Windows the SDK brings its own copy; nothing to do. On Linux the SDK package
recommends it but does not install it:
sudo apt install ffmpegUbuntu's and JetPack's own ffmpeg packages work. Without it, a video call answers
with the error Video needs ffmpeg on this machine.
Each time the SDK starts, the AI fetches its model keys from
https://central.skylarklabs.ai, and on the first start it downloads the models
themselves (a few gigabytes; minutes on a good connection). Once the models are loaded
the SDK works without internet access.
Set it up
Install the Hub and sign in
Install the Hub and sign in. On the Linux desktop
Hub, hubctl is installed alongside, so the commands below work in a terminal too.
Activate the machine
If you signed in with the License key tab and install Kepler AI in the next step, the Hub writes the activation file for you. Otherwise, once:
sudo hubctl activate <org-key>Install Kepler AI
In the library, install the Kepler AI build the Hub offers for this machine: Kepler Workstation AI or Kepler Hailo AI. It can stay stopped. If you start it, wait until its row reads Running before starting the SDK.
Install the Skylark SDK
Scroll to Developers at the bottom of the library. Until a Kepler AI build is installed, the Skylark SDK card reads Needs an AI service; the SDK can be installed in that state but not started. Select Install; it downloads, verifies and installs like every other product, after your password prompt.
Start it
Select Start on the card and enter your password in the Authentication
Required prompt. The prompt says it needs to run /usr/bin/sh as the super user:
that is the Hub starting the SDK's service. The card then shows Loading models…
with the URL to copy, http://127.0.0.1:8092/v1, and Running once the models are
loaded. The first start takes a few minutes; later starts, one or two.
If Start is disabled, hover over it: either no AI service is installed yet (step 3) or the machine is not activated yet (step 2).
Check it works
From the machine itself, without a key:
curl -s http://127.0.0.1:8092/healthz{"ai":"ok","enabled":true,"mode":"local","models":5,"status":"ok","storage":{},"uptimeSec":42,"version":"1.0.0"}mode is local and ai is ok. Then one real detection, with the organization key:
curl -s -X POST http://127.0.0.1:8092/v1/infer/image \
-H "Authorization: Bearer <org-key>" \
-F "model=CFAM-CCTV" -F "file=@street.jpg" | head -c 600A clear photo with people or vehicles in it comes back with detections, each with a
class, a confidence and a bbox (a small thumbnail may return none; use a real
camera-sized frame). The credits block is still there so clients don't break: cost
counts the frame, costMicros is 0 and remaining is unlimited. Nothing is metered on
your own machine.
Call it from your code
Use any of the SDK clients with two changes:
- The base URL is
http://127.0.0.1:8092/v1(or setSKYLARK_BASE_URLto it; the Python and Node clients read that variable). - The API key is the organization license key the machine was activated with.
The SDK serves its own copy of each client, so the machine's own build is always the one you download, even without internet access. Save it next to your script and import it from there:
curl -o skylark_models.py http://127.0.0.1:8092/v1/sdk/python # or /sdk/node, /sdk/ts, /sdk/browserfrom skylark_models import Skylark
sky = Skylark("<org-key>", base_url="http://127.0.0.1:8092/v1")
for m in sky.models.list(): # the five CFAM models
print(m["id"], m["detects"])
model = sky.models.load("CFAM-CCTV")
result = model.predict("street.jpg") # an image
people = [d for d in result["detections"] if d["class"] == "person"]
clip = model.predict_video("clip.mp4") # a video file: frames with timestamps
live = model.stream("rtsp://192.168.1.20/stream1", fps=2) # a camera on your network
for e in live.events(): # analyzed frames as they arrive
print(e["seq"], len(e["detections"]))Everything about the calls and their results is on the SDK pages: the models, the raw output, the error codes and the full API reference.
Images, videos and cameras
- Images are one request, one answer.
- Video files are a job: the server samples frames and runs each, and the client polls
until it finishes. Nothing is re-encoded and no video comes back, only frames with
timestamps. Needs
ffmpegon the machine. - Cameras are RTSP streams the SDK pulls itself, at
fpsframes a second. Point it at a camera on your network: a stream address on the machine itself (127.0.0.1, or any of the machine's own addresses) is refused with This stream address is not allowed. Up to four streams can run at once, for up to 24 hours each, and a stream nobody reads for a couple of minutes is stopped as idle. Needsffmpegtoo.
What's different from the cloud
| Cloud | On this machine | |
|---|---|---|
| Base URL | https://sdk.skylarklabs.ai/v1 | http://127.0.0.1:8092/v1 |
| Key | skl_… from the console | The organization license key |
| Cost and limits | Per frame, with monthly caps | Nothing metered; credits keeps counting frames with costMicros 0 and no cap |
| Console, API keys, usage pages | Yes | No. /v1/auth/* and the console routes answer 404 |
| Models | The current catalog | The same five models, loaded on this machine's accelerator |
| Concurrency | Shared | This machine's: a few requests in flight, four camera streams |
| Availability | Always on | While you keep it started; off after a restart of the machine |
Day to day
| Command | What it does |
|---|---|
sudo hubctl sdk start | Starts the SDK and pauses Kepler's AI service. Running it again while it runs is a no-op. |
hubctl sdk status | Whether it runs, its URL, and whether the models are loaded (AI: ok). |
sudo hubctl sdk logs [-f] | Its log, the AI server's included: model downloads, load progress, errors. Needs sudo (or membership of the systemd-journal group) to read the journal. |
sudo hubctl sdk stop | Stops it; Kepler's AI service starts again if it was running before. |
sudo hubctl sdk start --listen 0.0.0.0:8092 | Starts it reachable from other machines; see below. |
hubctl update / sudo hubctl update --yes | Lists and applies updates, the SDK's included. Stop the SDK first; a running one is skipped. |
sudo hubctl uninstall skylark-sdk | Removes the SDK, stopping it first if it runs. Kepler AI stays. |
Add --json to any hubctl command for machine-readable output. All of this needs a
hubctl that knows the SDK; hubctl --version shows yours, and
sudo hubctl self-update fetches the current one.
On the desktop Hub the same actions are on the Skylark SDK card under Developers in
the library: Install, Update, Start and Stop. On Linux, Start and Stop each
ask for your password (the prompt names /usr/bin/sh or /usr/bin/systemctl); on Windows
they ask for nothing. Stopping takes a few seconds while the AI server shuts down. While the SDK runs, the Kepler
AI row shows In use by the Skylark SDK and its own Start, Update and Uninstall are off.
With developer mode on, the Logs page lists the SDK as a source. On
Windows its log is the file %USERPROFILE%\.config\skylark-sdk\logs\sdk.log.
After a restart of the machine the SDK is off and Kepler AI is running again. Start the SDK again when you need it; it does not start on its own, by design, so a Kepler site is never left without its AI by accident.
If the SDK crashes, Kepler's AI service is started again automatically (on Windows, as
soon as the Hub notices, within a few seconds while it is open), and the card
shows Stopped with an error with a See what happened link to its log
(sudo hubctl sdk logs on a server). Start it again once you've looked.
Reach it from other machines
By default the API answers on the machine itself only. To call it from other machines on
your network (Linux, with hubctl; the Windows Hub keeps it on the PC itself):
sudo hubctl sdk start --listen 0.0.0.0:8092hubctl sdk status then notes the address it listens on, and your code uses
http://<machine-ip>:8092/v1 with the same key.
Trusted networks only
The API speaks plain HTTP, and the key your code sends is your organization's license
key, which licenses every Skylark product you hold. Anyone who can read traffic on that
network can read the key. Keep it to a trusted network or a VPN, or put a TLS proxy in
front; hubctl prints this warning when it starts on a non-loopback address.
To change the address, stop the SDK and start it again; starting it on a second address while it runs is refused.
Next
- Something not working? See Skylark SDK on this machine: troubleshooting, which also lists the files, ports and limits involved.
- The SDK quickstart and SDKs pages cover the calls in depth; everything there applies here, apart from keys and billing.
Hardware and AI profiles
What Skylark Hub checks on your machine, how it picks the right Kepler AI build, and why an install can be blocked.
Skylark SDK on this machine: troubleshooting
What to do when the Skylark SDK won't start, stays on "Loading models", refuses your key or your camera, and the files, ports and limits behind it.