Skip to main content

FIBER Python SDK

Official Python SDK and command-line tool for the FIBER AI Data Center Optical Intelligence Platform.

FIBER collects and normalizes optical-link telemetry from every major vendor (NVIDIA, Arista, Cisco, Juniper) via OpenConfig gNMI, maps link anomalies to GPU/Slurm/K8s workloads, and recommends what to replace and when.

  • Sync client (FiberClient) and async client (AsyncFiberClient)
  • Typed Pydantic v2 response models
  • Rich CLI (fiber) with coloured tables and progress spinners
  • MIT licensed

Installation

pip install fiber-sdk

Requires Python 3.9+.


Quickstart

Synchronous

from fiber_sdk import FiberClient

with FiberClient(api_key="fiber_xxx", base_url="https://api.fiber.ac") as client:
    overview = client.overview()
    print(f"Total ports: {overview.total_ports}")
    print(f"Critical:    {overview.critical} ({overview.critical_pct}%)")

    # Top 5 riskiest ports
    for port in client.ports.critical(limit=5):
        print(f"{port.switch_name}:{port.port_name}  risk={port.risk_score:.0f}")

    # Generate diagnosis on a suspect port
    report = client.diagnosis.generate("spine-003", "Ethernet1/5")
    print(report["root_cause"]["description"])

    # Ask the AI assistant a natural-language question
    answer = client.ai.query("which vendor has the highest FEC errors this week?")
    print(answer["summary"])

Asynchronous

import asyncio
from fiber_sdk import AsyncFiberClient


async def main() -> None:
    async with AsyncFiberClient(api_key="fiber_xxx") as client:
        overview = await client.overview()
        print(overview.model_dump())

        ports = await client.ports.list(severity="critical", limit=10)
        for p in ports.ports:
            print(p.switch_name, p.port_name, p.risk_score)


asyncio.run(main())

Environment variables

Both clients read FIBER_API_KEY if no api_key= argument is provided.

export FIBER_API_KEY="fiber_xxx"
export FIBER_BASE_URL="https://api.fiber.ac"  # optional

CLI

The SDK installs a fiber command-line tool.

# Help
fiber --help

# Cluster overview
fiber overview

# List 5 most critical ports
fiber ports list --severity critical --limit 5

# Port history for the last 6 hours
fiber ports history spine-003 Ethernet1/5 --hours 6

# Recent alerts
fiber alerts list --severity critical --limit 20

# Generate a diagnosis report
fiber diagnose spine-003 Ethernet1/5

# Agentic AI investigation (needs ANTHROPIC_API_KEY on the server)
fiber diagnose spine-003 Ethernet1/5 --ai

# Natural-language AI query
fiber ai query "which ports have had temperature above 75C this week?"

# Inventory
fiber inventory summary
fiber inventory list --vendor Arista --limit 20

# ROI analysis
fiber roi

# Who am I?
fiber whoami

# Blast-radius simulation
fiber topology simulate-failure spine-003 Ethernet1/5

# Any command with --json for raw JSON output
fiber --json overview

CLI configuration

Flag Env var Default
--api-key FIBER_API_KEY (required)
--base-url FIBER_BASE_URL https://api.fiber.ac
--json (none) off

Authentication

Every request sends an Authorization: Bearer <api_key> header. Your key must be created by an admin:

admin = FiberClient(api_key="fiber_admin_xxx")
created = admin.admin.create_key(name="my-automation", role="viewer", tenant_id="default")
print(created["key"])  # Only shown once!

Available roles: viewer, operator, admin.


Error handling

All API errors raise subclasses of FiberError:

from fiber_sdk import (
    FiberClient,
    FiberAuthError,
    FiberNotFoundError,
    FiberRateLimitError,
    FiberServerError,
    FiberError,
)

with FiberClient(api_key="fiber_xxx") as client:
    try:
        report = client.diagnosis.get("non-existent-id")
    except FiberNotFoundError:
        print("Report does not exist.")
    except FiberAuthError as e:
        print(f"Auth problem: {e.message}")
    except FiberRateLimitError:
        print("Slow down!")
    except FiberServerError as e:
        print(f"Server error {e.status_code}: {e.message}")
    except FiberError as e:
        print(f"Unexpected error: {e}")

Each exception carries status_code, message, and the parsed response_json (if any).


API coverage

Section Methods
client.health() Health status
client.info() API version/features
client.overview() Cluster summary
client.ports list, history, critical
client.alerts list, top
client.topology get, simulate_failure
client.maintenance list, spare_parts, windows
client.diagnosis generate, list, get
client.ai query, investigate, postmortem, explain
client.inventory list, summary, update
client.rma list, create, vendor_quality
client.admin whoami, create_key, list_keys, revoke_key
client.export ports_csv, alerts_csv, maintenance_csv
client.predictions() UFM failure predictions
client.trends() Long-term analytics
client.roi() ROI metrics

Development

From a checkout of the FIBER source (the repository is private; ask the FIBER team for access):

cd sdks/python
pip install -e ".[dev]"
pytest
mypy fiber_sdk
ruff check fiber_sdk


License

MIT - see LICENSE.

Metadata

Release files for fiber-sdk 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fiber-sdk 1.1.0
File Size Uploaded Provenance Actions
fiber_sdk-1.1.0.tar.gz 25.5 kB Without provenance Details for fiber_sdk-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fiber-sdk 1.1.0
File Interpreter ABI Platform Actions
fiber_sdk-1.1.0-py3-none-any.whl Python 3 none any Details for fiber_sdk-1.1.0-py3-none-any.whl

Total release size: 47.7 kB

Release files / fiber_sdk-1.1.0.tar.gz

Download URL fiber_sdk-1.1.0.tar.gz
Size 25.5 kB
Tags Source
SHA-256 checksum
How to use checksums
6792857b1d7360676356ef1d9a4432b4a21c1550ffb64d6b064e884fdca6483f
BLAKE2b-256 checksum
How to use checksums
7c5724abf3c2df07030b506e741165b8925225158d489fdab3048c16bb63a741
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.16

Release files / fiber_sdk-1.1.0-py3-none-any.whl

Download URL fiber_sdk-1.1.0-py3-none-any.whl
Size 22.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
163e24757475db786782cf40e30fd3858dfc224b49e8f95e0be379a9af4bd948
BLAKE2b-256 checksum
How to use checksums
6f7affa9447d99b5411595d34755f6fd3e2533c1133ce3acdef872b54909f664
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.16

Security for fiber-sdk 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page