hol-cigar
Local context graphs, exact token budgets, source citations and reviewed answers for Python applications. No HOL service, account, API key, daemon or database is required. CIGAR owns a Rust graph in a persistent local worker process.
Install and check
Version 0.11.0 supports Python >=3.14 <3.15. The PyPI distribution is hol-cigar;
the Python import is cigar_sdk. The corresponding npm package is @hol-org/cigar.
python3.14 -m pip install 'hol-cigar==0.11.0'
python3.14 -m cigar_sdk.local_cli doctor
python3.14 -m cigar_sdk.local_cli demo
When evaluating an unpublished candidate, install the exact wheel for your platform
instead of the registry version. Release status is recorded in the repository's
distribution plan.
The environment also gets a cigar-context command. doctor verifies a real local
compile; demo runs the complete workflow. Add --json for machine-readable results.
Local context graph (no server or model required)
from cigar_sdk import LocalContextGraph
with LocalContextGraph("my-project") as graph:
graph.replace_source("src/auth.py", [
{"id": "authorize", "source": "src/auth.py", "text": "def authorize(user):\n return user.active\n"}
])
result = graph.compile({"query": "authorize", "max_tokens": 1024, "reserve_tokens": 128})
context_text = result["rendered"] # place in your prompt's DATA/context role
assert result["snapshot"]["stats"]["rendered_tokens"] <= 896
The persistent worker retains incremental indexes and its bounded exact o200k_base cache.
upsert, remove, link/unlink, atomic replace_source, line-preserving chunks,
compile, verify, delta, apply_delta, stats, and clear_cache expose the Rust core.
Source replacement reuses unchanged indexed documents. The optional prompt_view(snapshot, max_tokens) returns a LocalContextPrompt with all selected text and short citation handles.
Keep its citation map and full snapshot; use verify_prompt(prompt, snapshot) or
resolve_citation("c1", prompt, snapshot) against the expected authorized snapshot. Its
separate exact budget fails without truncation. Token savings depend on citation overhead.
Input/request/snapshot types are exported as LocalDocument, LocalContextRequest,
LocalContextSnapshot, etc. Local methods are synchronous and thread-serialized; the existing
AsyncCigarClient remains the asynchronous remote client.
required IDs include their complete hard dependency/contradiction closure. Pass allowed
on every call when source permissions differ ([] authorizes none; omission permits the
whole caller-owned graph). excerpt_mode="query_windows" is opt-in; full text is the default.
Source withdrawal preserves hard edges, so missing required evidence fails closed. Snapshot
digests are integrity commitments, not signatures or authority. Deltas reduce transport/storage
bytes, not stateless model prompt tokens. Token budgets include Rust-rendered citations but
exclude the provider envelope; reserve that separately. Retrieval optimizations preserve the
previous selected evidence. Answer review adds a host-enforced release contract;
it does not establish real-model quality without a separately evaluated reviewer.
Use with or close() to release the worker. Each graph owns one process and privacy-local
cache. Defaults: 30-second call timeout, 32 MiB request, 64 MiB response, 100k documents,
256 MiB indexed text, 2048 cache entries/8 MiB cached text. Customize limits and timeout.
Cache clearing drops strings but does not guarantee memory zeroization. A LocalContextError
has a content-free code; timeout/protocol/pipe failure closes the graph and never retries
mutations. Invalid wire fields also close it. A lock-wait Busy error leaves the active call alone.
The 0.11.0 wheel matrix includes macOS 11+ ARM64/x64, Linux x64/ARM64 with glibc 2.28+ or musl 1.2+, and Windows x64. The release checks require every advertised wheel before publication. Each platform wheel contains its worker and needs no Rust compiler.
The portable source distribution and wheels built without native staging retain all SDK APIs,
but local graphs require an explicit trusted absolute worker_path. Build it from the matching
0.11.0 Rust source using Rust 1.92+:
cargo build --locked --release -p cigar-context --features bpe --bin cigar-context-worker
Pass the resulting executable to LocalContextGraph("my-project", worker_path="/absolute/path/to/cigar-context-worker").
No PATH discovery, install-time downloads, shell invocation, or automatic filesystem ingestion
occurs. Bundled worker bytes are checked against their package manifest before launch; this is
not a substitute for trusting the package publisher. The subprocess runs with your OS privileges
and inherits its environment; it is not a security sandbox. It adds startup/IPC/memory overhead
compared with embedding Rust directly. Reuse graphs to amortize initialization.
Complete workflow and diagnostics
The same complete example run by cigar-context demo is importable:
from cigar_sdk.examples.local_workflow import run_local_workflow
result = run_local_workflow()
print(result["status"]) # passed
It covers ingestion, dependencies, authorized compilation, compact citations, cache reuse, trusted fixture reviews, source updates, deltas and stale-review rejection. Its reviewer uses separately authored fixture facts. Replace it with an authenticated semantic reviewer for real answers. Reuse your application's graph across requests.
from cigar_sdk import get_local_context_capabilities
capability = get_local_context_capabilities()
print(capability["platform"], capability["worker_available"], capability["guidance"])
The capability API inspects platform and bytes without starting a worker. doctor
also compiles synthetic context and verifies it. Missing/unexecutable workers report
WorkerUnavailable, absent platform support reports UnsupportedPlatform, and altered
worker bytes report WorkerIntegrity. These errors do not mean HOL services are missing.
An explicitly supplied matching worker can be checked with
python -m cigar_sdk.local_cli doctor --worker /absolute/path.
The installed cigar_sdk package includes AGENT_GUIDE.md and llms.txt. The
agent integration guide
explains explicit file ingestion, graph relationships, authorization and reviewed answers.
Compatible remote client
Choose AsyncCigarClient or CigarClient when connecting to an existing CIGAR server.
Both expose all 45 frozen v1 operations, bounded deadlines, typed problems, resumable
streams, pagination, fixed idempotency keys, safe retry and local bundle/delta verification.
They accept your server's URL; HOL hosting is optional. CONTEXT_ABI remains cigar.context.v1.
from cigar_sdk import AsyncCigarClient, TypedOperationRequest, create_idempotency_key, models
async with AsyncCigarClient("https://cigar.example", bearer_token=token_provider) as client:
result = await client.compile_context_bundle(
TypedOperationRequest(
models.CompileContextBundleRequest(plan_id=plan_id),
idempotency_key=create_idempotency_key("compile"),
)
)
Every nominal request and response is validated against the frozen payload schema. Mutating retries reuse the exact caller-provided key and bytes. Effect dispatch is always one attempt. Synchronous and asynchronous streams are explicit context managers so callers can close the underlying response deterministically.
Token providers accept the remaining call timeout in seconds. Injecting a custom
HttpTransport requires trust_custom_transport=True; the default transport ignores
ambient proxies and refuses redirects. The wheel and source distribution both include
the shared fixture, so cigar-qualify-bundle works from a clean installation.
Honey distributions also install cigar-agent-b-handoff. It accepts an existing recipient-bound
handoff, then records one typed, evidence-backed result with independent idempotency keys. The
Agent B bearer token is read only from CIGAR_AGENT_B_TOKEN, never a command-line argument. Run
cigar-agent-b-handoff --help for the required handoff, plan, base-commit, revision, claim,
evidence, and caller-generated acceptance/result idempotency keys. The example requests no
follow-up capability and never dispatches an effect.
Remote HTTPS construction requires an explicit bearer_token value or provider. The SDK never
discovers credentials from the URL, environment, project configuration, proxy settings, or a
redirect target. Explicit cleartext loopback mode remains available only for local development.
Answer review
Call graph.review_keys(draft) to bind an AnswerDraft's claims to the snapshot
provided to the generator. Obtain LocalClaimReview verdicts through a separate,
trusted host review path, then call graph.check_answer(request, draft, reviews).
Only display the assessed claims when decision == "release". The check recompiles
current authorized context and rejects stale snapshots/reviews. Missing reviews,
unresolved support, invalid citations or unreviewed explicit conflicts block release.
confidence_bps is optional telemetry (0–10000), never permission. Keep reviews and
policy outside model control; CIGAR does not run a semantic judge. See the
core contract.
Release files for hol-cigar 0.11.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| hol_cigar-0.11.0.tar.gz | 113.5 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| hol_cigar-0.11.0-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details |
| hol_cigar-0.11.0-py3-none-musllinux_1_2_x86_64.whl | Python 3 | none | Linux musl 1.2+ x86-64 | Details |
| hol_cigar-0.11.0-py3-none-musllinux_1_2_aarch64.whl | Python 3 | none | Linux musl 1.2+ ARM64 | Details |
| hol_cigar-0.11.0-py3-none-manylinux_2_28_x86_64.whl | Python 3 | none | Linux glibc 2.28+ x86-64 | Details |
| hol_cigar-0.11.0-py3-none-manylinux_2_28_aarch64.whl | Python 3 | none | Linux glibc 2.28+ ARM64 | Details |
| hol_cigar-0.11.0-py3-none-macosx_11_0_x86_64.whl | Python 3 | none | macOS 11.0+ x86-64 | Details |
| hol_cigar-0.11.0-py3-none-macosx_11_0_arm64.whl | Python 3 | none | macOS 11.0+ ARM64 | Details |
Total release size: 23.2 MB
Release files / hol_cigar-0.11.0.tar.gz
| Download URL | hol_cigar-0.11.0.tar.gz |
|---|---|
| Size | 113.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d864bbc316b554afc72f40ae9277bd73b12815682ddece7f46a1898c6fdbfdc7
|
|
BLAKE2b-256 checksum How to use checksums |
b51e8b0573204bbbaba3853b2efdbdcc5f0d56d1a6796f05d3fad20fcb5aae66
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.
Transparency logRelease files / hol_cigar-0.11.0-py3-none-win_amd64.whl
| Download URL | hol_cigar-0.11.0-py3-none-win_amd64.whl |
|---|---|
| Size | 3.1 MB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
1fa0587b03a3867cb168c4344bba2c53d3eaca8b4c8b59b1eabd560e046fd863
|
|
BLAKE2b-256 checksum How to use checksums |
46e1fef699d9e7fc8ae83440a98e118d3c127925c74ec1bc3f0d8e7a5d7556b5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.
Transparency logRelease files / hol_cigar-0.11.0-py3-none-musllinux_1_2_x86_64.whl
| Download URL | hol_cigar-0.11.0-py3-none-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 3.4 MB |
| Tags | Linux musl 1.2+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
ee15458abb214eedc85ce60806c4040f12af974b3936bd5da10691ddd96d75da
|
|
BLAKE2b-256 checksum How to use checksums |
227f7c3e170cc25597115f1eda22f05794f00f3b12a9252059cff94f09e6a426
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.
Transparency logRelease files / hol_cigar-0.11.0-py3-none-musllinux_1_2_aarch64.whl
| Download URL | hol_cigar-0.11.0-py3-none-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 3.3 MB |
| Tags | Linux musl 1.2+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
fec3ad5355c19823bcbe2369908ba7cc5b4d31df1d92b56cb04db718760b1c60
|
|
BLAKE2b-256 checksum How to use checksums |
eacf02cc590e984f020c47a77327dd348fc56a8eac5b73802dbe2b54db954e03
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.
Transparency logRelease files / hol_cigar-0.11.0-py3-none-manylinux_2_28_x86_64.whl
| Download URL | hol_cigar-0.11.0-py3-none-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 3.4 MB |
| Tags | Linux glibc 2.28+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
ae378458cd22e8f093c9e56b676f3da5291673dd49668d7a125350e496ddd2c2
|
|
BLAKE2b-256 checksum How to use checksums |
485ba43558dba921124c8c3e0f30420abd8a06beff1f0e4ddd8ec0923cf36dfe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.
Transparency logRelease files / hol_cigar-0.11.0-py3-none-manylinux_2_28_aarch64.whl
| Download URL | hol_cigar-0.11.0-py3-none-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 3.3 MB |
| Tags | Linux glibc 2.28+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
414ff45797fa7367b077f17363210d7fd2309c9284dfa60e5e67a4ff840da345
|
|
BLAKE2b-256 checksum How to use checksums |
24e1fe7a697a9592adcd7fc1df21b80d458f701649a75ac1877c198961b062f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.
Transparency logRelease files / hol_cigar-0.11.0-py3-none-macosx_11_0_x86_64.whl
| Download URL | hol_cigar-0.11.0-py3-none-macosx_11_0_x86_64.whl |
|---|---|
| Size | 3.3 MB |
| Tags | Python 3 macOS 11.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
39e422dcdd68909449ece1c2c69b57d7e745fc9585eddde224616d3343c7e268
|
|
BLAKE2b-256 checksum How to use checksums |
b9ba9461027862fb36dd8f8e0a2d45cf9b251680d9c30f63804505536d8f4b0e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.
Transparency logRelease files / hol_cigar-0.11.0-py3-none-macosx_11_0_arm64.whl
| Download URL | hol_cigar-0.11.0-py3-none-macosx_11_0_arm64.whl |
|---|---|
| Size | 3.2 MB |
| Tags | Python 3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
e39771510b67b553acd57429f923557210c8f081c66649d5541ec0ec1585327c
|
|
BLAKE2b-256 checksum How to use checksums |
f0c603d2ca8ec6191b8a86709c0e17e394f5356186a024772b51f1e8faa777f4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.
Transparency log