ShapleyCut service
Project description
ShapleyCut API
Dedicated service for the ShapleyCut compression engine. This package exposes HTTP endpoints for optimizing memory and running the gateway mode.
Install
pip install shapleycut-api
Quickstart
python -m uvicorn shapleycut_api.main:app --host 0.0.0.0 --port 8000
If you are on Python 3.14 and see httptools errors, use:
python -m uvicorn shapleycut_api.main:app --host 0.0.0.0 --port 8000 --http h11
SDK snippet (Python)
from shapleycut import MemoryMessage, optimize_messages
messages = [
MemoryMessage(role="system", content="You are a helpful assistant."),
MemoryMessage(role="user", content="Summarize the project status."),
MemoryMessage(role="assistant", content="We shipped MVP and added gateway mode."),
]
out = optimize_messages(messages, max_output_tokens=512)
print(out.optimized_memory)
Endpoints
GET /healthPOST /v1/optimizePOST /v1/chat/completionsPOST /v1/responsesGET /v1/metricsGET /v1/metrics/export
Environment
LLM credentials (server side only):
GITHUB_TOKENorGH_TOKENGITHUB_INFERENCE_BASE_URL(default:https://models.github.ai/inference)OPENAI_API_KEYOPENAI_BASE_URL(default:https://api.openai.com/v1)
Gateway settings:
SHAPLEYCUT_GATEWAY_PROVIDER(github_azure,openai,anthropic)SHAPLEYCUT_GATEWAY_BASE_URLSHAPLEYCUT_GATEWAY_API_KEY_ENVSHAPLEYCUT_GATEWAY_API_KEYSHAPLEYCUT_GATEWAY_REQUIRE_KEYSHAPLEYCUT_GATEWAY_ALLOW_OVERRIDESHAPLEYCUT_GATEWAY_LOGSHAPLEYCUT_GATEWAY_DBSHAPLEYCUT_GATEWAY_METRICS_MAXSHAPLEYCUT_GATEWAY_CACHE_MAXSHAPLEYCUT_GATEWAY_CACHE_TTL_S
Notes
/v1/responsesis not supported whenSHAPLEYCUT_GATEWAY_PROVIDER=github_azure. Use/v1/chat/completionsor set the provider toopenai.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file shapleycut_api-0.2.3.tar.gz.
File metadata
- Download URL: shapleycut_api-0.2.3.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1d206a3e1f2eae0a41f754349ba58950d6a13882e600bb6459e0f0817da1b3f9
|
|
| MD5 |
c5d70d11ec8565866a664a7a58d6f846
|
|
| BLAKE2b-256 |
dba500dbbc2539226f3d78f71d011469fee634114b910c44b237e6909a459544
|
Provenance
The following attestation bundles were made for shapleycut_api-0.2.3.tar.gz:
Publisher:
publish.yml on iv4n-ga6l/ShapleyCut
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
shapleycut_api-0.2.3.tar.gz -
Subject digest:
1d206a3e1f2eae0a41f754349ba58950d6a13882e600bb6459e0f0817da1b3f9 - Sigstore transparency entry: 1246962039
- Sigstore integration time:
-
Permalink:
iv4n-ga6l/ShapleyCut@287bed3b7e9c1b42ecb78182c0cd7d913d605798 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/iv4n-ga6l
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@287bed3b7e9c1b42ecb78182c0cd7d913d605798 -
Trigger Event:
push
-
Statement type:
File details
Details for the file shapleycut_api-0.2.3-py3-none-any.whl.
File metadata
- Download URL: shapleycut_api-0.2.3-py3-none-any.whl
- Upload date:
- Size: 9.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fca85d7193e19d681484d03104e9d4f23e92aa8094e15baa66af0e5bbd20a47d
|
|
| MD5 |
f304a4153d5cdbe7d3a71f08cc25e4b2
|
|
| BLAKE2b-256 |
f57430ec1f3f8b643f1489f1b9bf5abf2dccca1622fc9fa1f1be1112326c8919
|
Provenance
The following attestation bundles were made for shapleycut_api-0.2.3-py3-none-any.whl:
Publisher:
publish.yml on iv4n-ga6l/ShapleyCut
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
shapleycut_api-0.2.3-py3-none-any.whl -
Subject digest:
fca85d7193e19d681484d03104e9d4f23e92aa8094e15baa66af0e5bbd20a47d - Sigstore transparency entry: 1246962536
- Sigstore integration time:
-
Permalink:
iv4n-ga6l/ShapleyCut@287bed3b7e9c1b42ecb78182c0cd7d913d605798 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/iv4n-ga6l
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@287bed3b7e9c1b42ecb78182c0cd7d913d605798 -
Trigger Event:
push
-
Statement type: