Skylark Hub
Skylark Hub

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 SDKSDK on this machine (this page)Skylark Edge
Where the model runsSkylark's serversYour Jetson, workstation or Hailo boxYour machine, inside your Python process
How you call itREST, any languageREST, any language, same clientsPython package
Keyskl_… API key from the consoleYour organization's license keyYour organization's license key
BillingPer frameNothing is meteredNothing is metered
NeedsInternetKepler AI installed by the Hub; internet when it startsA model downloaded once
Live camerasYesYes, cameras on your networkNo

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

StartLibrary card, or hubctl sdk start
Takes over Kepler AIKepler's own AI service pauses
Loads the modelsFrom Skylark Central, once
Serves /v1http://127.0.0.1:8092
Start runs one service that takes over the machine's AI and serves the SDK API on it.

When you start the SDK, the Hub starts it in the background (on Linux, as a service named kepler-ai-sdk). It:

  1. finds the Kepler AI package the Hub installed (Jetson, Workstation or Hailo);
  2. 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;
  3. 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;
  4. 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.

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 600

A 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 set SKYLARK_BASE_URL to 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/browser
from 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 ffmpeg on the machine.
  • Cameras are RTSP streams the SDK pulls itself, at fps frames 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. Needs ffmpeg too.

What's different from the cloud

CloudOn this machine
Base URLhttps://sdk.skylarklabs.ai/v1http://127.0.0.1:8092/v1
Keyskl_… from the consoleThe organization license key
Cost and limitsPer frame, with monthly capsNothing metered; credits keeps counting frames with costMicros 0 and no cap
Console, API keys, usage pagesYesNo. /v1/auth/* and the console routes answer 404
ModelsThe current catalogThe same five models, loaded on this machine's accelerator
ConcurrencySharedThis machine's: a few requests in flight, four camera streams
AvailabilityAlways onWhile you keep it started; off after a restart of the machine

Day to day

CommandWhat it does
sudo hubctl sdk startStarts the SDK and pauses Kepler's AI service. Running it again while it runs is a no-op.
hubctl sdk statusWhether 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 stopStops it; Kepler's AI service starts again if it was running before.
sudo hubctl sdk start --listen 0.0.0.0:8092Starts it reachable from other machines; see below.
hubctl update / sudo hubctl update --yesLists and applies updates, the SDK's included. Stop the SDK first; a running one is skipped.
sudo hubctl uninstall skylark-sdkRemoves 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:8092

hubctl 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