Skip to main content

Python SDK for Admiral combinatorial optimization cloud

Project description

Admiral

Admiral

Combinatorial optimization cloud platform
Solve QUBO, Ising, CQM, MILP, Max-SAT and 6 more problem types
with specialized algorithms via cloud API, Python SDK, or CLI.

Docs · Pricing · Discord · Self-Host


Quick Start

pip install admiral-solver
from admiral import Solver
import numpy as np

solver = Solver(api_key="adm_sk_...")
Q = np.array([[-5, 2, 4], [0, -3, 1], [0, 0, -8]])
result = solver.solve_qubo(Q, timeout=30)
print(result.energy)     # -13.0
print(result.solution)   # [1, 0, 1]

Local mode (no server):

from admiral import LocalSolver
result = LocalSolver().solve_qubo(Q, solver="tabu", seed=42)

11 Problem Types

Type Formulation Variables Solvers
QUBO min x^TQx binary SB, PT, Tabu, Roof duality
Ising min Σhᵢsᵢ + ΣJᵢⱼsᵢsⱼ spin SB, PT, Tabu
HUBO min Σcₛ∏xᵢ binary Native SA, Quadratize→QUBO
DQM min Σaᵢ(xᵢ)+Σbᵢⱼ discrete Discrete SA/Tabu, Bucket elim
CQM min x^TQx+c^Tx s.t. Ax≤b mixed ADMM, Feasibility pump, B&C
MILP min c^Tx s.t. Ax≤b int+real Branch & cut, RINS
MIQP min x^TQx+c^Tx Ax≤b mixed QP B&C, ADMM
Max-SAT max Σwⱼ·sat(Cⱼ) boolean WalkSAT, Core-guided RC2
PBO min Σcⱼ∏lᵢ s.t. ≥b binary SAT cutting planes
WCSP min Σf(x) discrete VAC+B&B, LNS, BP
Potts min −ΣJδ(sᵢ,sⱼ) discrete Swendsen-Wang, Discrete PT

Architecture

Clients (SDK / REST / CLI)
        │
        ▼
   API Server (FastAPI)  ──▶  PostgreSQL
        │
        ▼
      Redis (job queue + rate limits)
        │
   ┌────┴────┐
   ▼         ▼
CPU Workers  GPU Workers
Tabu, B&C    SB, PT
ADMM, RC2

Self-Hosting

git clone https://github.com/admiral-dev/admiral-solver.git
cd admiral-solver
cp .env.example .env   # edit secrets
docker-compose up -d   # starts everything

Scale: docker-compose up -d --scale worker-cpu=8 --scale worker-gpu=4

K8s: kubectl apply -f deploy/k8s-api.yaml -f deploy/k8s-workers.yaml

CLI

admiral solve --type qubo --input problem.json --local
admiral convert --from qubo --to ising --input q.json
admiral bench --sizes 10,100,1000 --solver sb
admiral server start --port 8000
admiral worker start --redis redis://localhost:6379

API

curl -X POST https://api.admiral.dev/v1/solve \
  -H "Authorization: Bearer adm_sk_..." \
  -d '{"problem_type":"qubo","data":{"Q":[[-5,2,4],[0,-3,1],[0,0,-8]]}}'
Method Endpoint Description
POST /v1/solve Submit problem
GET /v1/jobs/{id} Status + result
GET /v1/jobs/{id}/pool Solution pool
POST /v1/analyze Complexity analysis
POST /v1/convert Format conversion
DELETE /v1/jobs/{id} Cancel
GET /v1/solvers List engines
GET /v1/health Health check

Development

pip install -e ".[dev]"
pytest tests/ -v
ruff check admiral/

License

Apache 2.0 — see LICENSE


Built by Admiral Technologies

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

admiral_solver-1.0.0-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

Details for the file admiral_solver-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: admiral_solver-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 15.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for admiral_solver-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7e6f800adc9d28c646124ebaa45a8571c6bd921e9fc9974d008d8901e63ec56d
MD5 5f2e0bef4d7787b46137809910704493
BLAKE2b-256 c0e2778e7c6ae646d3b55c803f95e59ab6b22e365fac9cf3113dfd2ab8dd5885

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