Reference
SDKs & Packages
All BRICQS packages are open source and published to PyPI and npm. Use the SDK for programmatic access, or the CLI for interactive and CI/CD workflows.
Python SDK
pip install bricqs-sdkQuick start
pythonfrom bricqs_sdk import BricqsClient
client = BricqsClient(api_key="<your-api-key>")
# Deploy a model (blocks until running)
dep = client.deployments.deploy(
name="my-llama-api",
model_id="meta-llama/Llama-3-8B-Instruct",
environment="production",
)
print(dep.endpoint)Deployments
python# List, get, stop, delete, promote
deps = client.deployments.list(environment="production")
dep = client.deployments.get("deployment-id")
logs = client.deployments.logs("deployment-id", lines=200)
metrics = client.deployments.metrics("deployment-id", hours=6)
summary = client.deployments.summary()
client.deployments.stop("deployment-id")
client.deployments.delete("deployment-id")
prod = client.deployments.promote("preview-id")
# Non-blocking deploy with progress polling
dep = client.deployments.deploy(name="my-api", model_id="meta-llama/Llama-3-8B-Instruct", wait=False)
for snapshot in client.deployments.poll(dep.id):
print(snapshot.stage)Error handling
pythonfrom bricqs_sdk import AuthError, NotFoundError, RateLimitError, BricqsError
try:
dep = client.deployments.get("bad-id")
except NotFoundError:
print("not found")
except AuthError:
print("invalid key")
except BricqsError as e:
print(f"error {e.status_code}: {e}")Node.js / TypeScript SDK
npm install bricqscloud-sdkQuick start
typescriptimport { BricqsClient } from 'bricqscloud-sdk';
const client = new BricqsClient({ apiKey: process.env.BRICQS_API_KEY! });
const dep = await client.deployments.deploy({
name: 'my-llama-api',
model_id: 'meta-llama/Llama-3-8B-Instruct',
environment: 'production',
});
console.log(dep.endpoint);Deployments
typescript// List, get, stop, delete, promote
const deps = await client.deployments.list({ environment: 'production' });
const dep = await client.deployments.get('deployment-id');
const logs = await client.deployments.logs('deployment-id', 200);
const metrics = await client.deployments.metrics('deployment-id', 6);
const summary = await client.deployments.summary();
await client.deployments.stop('deployment-id');
await client.deployments.delete('deployment-id');
const prod = await client.deployments.promote('preview-id');
// Async generator poll
for await (const snapshot of client.deployments.poll(dep.id)) {
console.log(snapshot.stage);
}Error handling
typescriptimport { AuthError, NotFoundError, RateLimitError, BricqsError } from 'bricqscloud-sdk';
try {
const dep = await client.deployments.get('bad-id');
} catch (err) {
if (err instanceof NotFoundError) console.log('not found');
if (err instanceof AuthError) console.log('invalid key');
if (err instanceof BricqsError) console.log(`error ${err.statusCode}: ${err.message}`);
}Note: Both SDKs require Node.js 18+ / Python 3.9+. The Node SDK works in Deno, Bun, and edge runtimes (Cloudflare Workers, Vercel Edge) that support native
fetch.CLI
bashpip install bricqs
bricqs login
bricqs deploy my-api --model meta-llama/Llama-3-8B-Instruct
bricqs status
bricqs logs <deployment-id>Full CLI reference: docs/cli