Skip to main content

LyboAI Mobile Edge Runtime — Python SDK for on-device AI agent creation, evaluation, and training workflows

Project description

lyboai (Python SDK)

Python is the builder's language for the LyboAI ecosystem: create agents, package and sign capability packs, run evaluations, tune routing, and export training datasets. Agents execute in the Rust runtime — locally via the lybo binary (this SDK drives it over the JSON-lines protocol, identical to the on-device C ABI) and on phones via the mobile bindings.

pip install -e sdk/python        # from the repo, or publish to your index
cargo build -p lybo-cli           # the runtime the SDK drives

Create an agent

from lyboai import Client

with Client(data_dir="/tmp/agent", binary="./target/debug/lybo") as lybo:
    lybo.install_knowledge(doc_id="handbook", title="Team Handbook",
                           body="Support tickets are answered within 24 hours.")
    lybo.register_skill(skill_id="app.ask", name="Ask the handbook",
                        triggers=["what does the handbook say"],
                        keywords=["handbook"], pattern="retrieval")

    session = lybo.start_session()
    out = lybo.run_to_completion(session, "what does the handbook say about tickets")
    print(out["output"]["text"], out["output"]["sources"])

Train routing from labelled examples

from lyboai import train_triggers

learned = train_triggers({
    "faq.ask":  ["what does the guide say about refunds", "search the faq"],
    "task.plan": ["plan my week", "break this goal into steps"],
})
# → per-skill {"triggers": [...], "keywords": [...]} via class-discriminative
#   tf-idf; feeds both the keyword tier and the on-device semantic centroids.

Build, sign, evaluate, ship a pack

from lyboai import PackBuilder, sign_pack, evaluate

src = (PackBuilder("acme.faq", "FAQ", "1.0.0", publisher="acme")
       .add_knowledge("faq", "Store FAQ", "Refunds take five business days.")
       .add_skill("faq.ask", "Ask FAQ", pattern="retrieval",
                  triggers=learned["faq.ask"]["triggers"],
                  keywords=learned["faq.ask"]["keywords"],
                  knowledge_scopes=["acme.faq"])
       .add_eval_case("faq.suite", "routes", "what does the guide say about refunds",
                      expect_skill="faq.ask", expect_contains=["refund"])
       .save("pack.json"))
sign_pack("pack.json", SECRET_KEY_HEX, "dist/acme-faq.lybopack")

with Client(data_dir="/tmp/qa", trust=[f"acme:{PUBLIC_KEY_HEX}"]) as lybo:
    lybo.install_pack_file("dist/acme-faq.lybopack")
    report = evaluate(lybo, suite)          # routing + outcome + content checks
    assert report.ok, report.summary()      # gate your CI on this

Export training data (privacy-preserving)

from lyboai import export_routing_dataset
export_routing_dataset(lybo, "routing.jsonl")
# skill ids, confidence, outcomes, latency, model ids — never raw user content.

Run the SDK's own tests: LYBO_BIN=./target/debug/lybo python3 -m unittest discover sdk/python/tests

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

lyboai-0.1.0.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

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

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for lyboai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 553a38af75f7c15d24dc451bf78cf5d0b9a321d838413d8a36b6e749321d5f70
MD5 507d05d2188e68e4d3318eaa7c8e8202
BLAKE2b-256 b160ae67af762604eb96c9161091a83e8c752c7eab0fda1bc75f125fb1696a3b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lyboai-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for lyboai-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5f9a2092de6f16ddc78db7cc431a9a524eae4dbc11fd2a4005a4b1444634fde1
MD5 b3ac0e6f9e3668817addf7478c2f5d12
BLAKE2b-256 f19e19ff04dc2b2d6919078f6273d58eb1c9628058a3e1a35612bb1736eb59f7

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