Awareness SDK
Python SDK for LatentMAS Awareness Marketplace - Trade AI latent vectors (KV-Cache memories) and W-Matrix alignment tools.
Features
- Memory Exchange: Publish, purchase, and browse KV-Cache memories and reasoning chains
- W-Matrix Marketplace: Create, browse, and purchase W-Matrix alignment tools for cross-model transformation
- Type-Safe: Full type hints for better IDE support
- Easy to Use: Simple, intuitive API design
- Production Ready: Comprehensive error handling and validation
Installation
pip install awareness-sdk
Quick Start
from awareness_sdk import AwarenessClient
# Initialize client with your API key
client = AwarenessClient(api_key="your_api_key")
# Browse available memories
memories = client.memory_exchange.browse_memories(
memory_type="kv_cache",
max_price=50.0,
limit=10
)
for memory in memories['memories']:
print(f"Memory #{memory['id']}: ${memory['price']}")
# Browse W-Matrix listings
listings = client.w_matrix.browse_listings(
source_model="gpt-3.5",
target_model="gpt-4",
sort_by="rating"
)
for listing in listings:
print(f"{listing['title']}: ${listing['price']}")
API Reference
Memory Exchange
Publish Memory
result = client.memory_exchange.publish_memory(
memory_type="kv_cache",
kv_cache_data={
"keys": [[1, 2, 3]],
"values": [[4, 5, 6]]
},
price=10.0,
description="GPT-3.5 conversation memory"
)
print(result['memory_id'])
Purchase Memory
result = client.memory_exchange.purchase_memory(
memory_id=12345,
target_model="gpt-4"
)
print(result['memory'])
Browse Memories
result = client.memory_exchange.browse_memories(
memory_type="kv_cache",
min_price=5.0,
max_price=50.0,
limit=20,
offset=0
)
for memory in result['memories']:
print(memory['id'], memory['price'], memory['status'])
Get Transaction History
result = client.memory_exchange.get_my_history(limit=10)
for tx in result['transactions']:
print(tx['id'], tx['status'], tx['price'])
Publish Reasoning Chain
result = client.memory_exchange.publish_reasoning_chain(
chain_name="Math Problem Solver",
description="Step-by-step math reasoning",
category="math",
kv_cache_snapshot={
"keys": [[...]],
"values": [[...]]
},
source_model="gpt-4",
price_per_use=5.0,
step_count=10
)
print(result['chain_id'])
Use Reasoning Chain
result = client.memory_exchange.use_reasoning_chain(
chain_id=123,
input_data={"problem": "2+2=?"},
target_model="gpt-4"
)
print(result['chain'])
Browse Reasoning Chains
result = client.memory_exchange.browse_reasoning_chains(
category="math",
max_price=10.0,
limit=10
)
for chain in result['chains']:
print(chain['chain_name'], chain['price_per_use'])
Get Marketplace Stats
stats = client.memory_exchange.get_stats()
print(f"Total memories: {stats['total_memories']}")
print(f"Total transactions: {stats['total_transactions']}")
print(f"Total volume: ${stats['total_volume']}")
W-Matrix Marketplace
Create Listing
result = client.w_matrix.create_listing(
title="GPT-3.5 to GPT-4 Alignment",
description="High-quality W-Matrix for GPT-3.5 → GPT-4 transformation",
source_model="gpt-3.5",
target_model="gpt-4",
source_dim=4096,
target_dim=8192,
price=100.0,
alignment_loss=0.001,
training_data_size=10000
)
print(result['listing_id'], result['matrix_id'])
Browse Listings
listings = client.w_matrix.browse_listings(
source_model="gpt-3.5",
target_model="gpt-4",
min_price=50.0,
max_price=200.0,
sort_by="rating", # Options: newest, price_asc, price_desc, rating, sales
limit=20
)
for listing in listings:
print(f"{listing['title']}: ${listing['price']}")
print(f" Rating: {listing['average_rating']}/5 ({listing['rating_count']} reviews)")
print(f" Sales: {listing['total_sales']}")
Purchase Listing
result = client.w_matrix.purchase_listing(
listing_id=123,
stripe_payment_intent_id="pi_1234567890"
)
print(f"Download URL: {result['download_url']}")
print(f"Expires at: {result['download_expires_at']}") # Valid for 7 days
Configuration
Production URLs
client = AwarenessClient(
api_key="your_api_key",
memory_exchange_url="https://api.awareness.market/memory-exchange",
w_matrix_url="https://api.awareness.market/w-matrix",
timeout=30
)
Health Check
status = client.health_check()
print(status)
# {
# 'memory_exchange': {'status': 'ok', 'version': '1.0.0'},
# 'w_matrix': {'status': 'ok', 'version': '1.0.0'}
# }
Error Handling
from awareness_sdk import (
AwarenessClient,
AuthenticationError,
APIError,
ValidationError,
NotFoundError,
NetworkError
)
try:
result = client.memory_exchange.purchase_memory(
memory_id=99999,
target_model="gpt-4"
)
except NotFoundError as e:
print(f"Memory not found: {e}")
except AuthenticationError as e:
print(f"Authentication failed: {e}")
except APIError as e:
print(f"API error: {e} (status code: {e.status_code})")
except NetworkError as e:
print(f"Network error: {e}")
Advanced Usage
Using Individual Clients
from awareness_sdk import MemoryExchangeClient, WMatrixClient
# Memory Exchange only
memory_client = MemoryExchangeClient(
base_url="http://localhost:8080",
api_key="your_api_key"
)
memories = memory_client.browse_memories(limit=10)
# W-Matrix Marketplace only
w_matrix_client = WMatrixClient(
base_url="http://localhost:8081",
api_key="your_api_key"
)
listings = w_matrix_client.browse_listings(limit=10)
API Documentation
For complete API documentation, visit:
- Swagger UI (Memory Exchange): http://localhost:8080/swagger/index.html
- Swagger UI (W-Matrix): http://localhost:8081/swagger/index.html
- Online Docs: https://awareness.market/docs
Support
- GitHub: https://github.com/everest-an/Awareness-Market
- Issues: https://github.com/everest-an/Awareness-Market/issues
- Email: support@awareness.market
- Website: https://awareness.market
License
MIT License - see LICENSE file for details
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
Changelog
1.0.0 (2026-01-04)
- Initial release
- Memory Exchange client with 8 endpoints
- W-Matrix Marketplace client with 3 endpoints
- Comprehensive error handling
- Full type hints support
- Production-ready
Metadata
Release files for awareness-sdk 1.0.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 | Provenance | |
|---|---|---|---|---|
| awareness_sdk-1.0.0.tar.gz | 11.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| awareness_sdk-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.8 kB
Release files / awareness_sdk-1.0.0.tar.gz
| Download URL | awareness_sdk-1.0.0.tar.gz |
|---|---|
| Size | 11.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
615e8b07e6ca1db9545b8bfd9f674e928895ab98e79a7adb9265ca2ee420986f
|
|
BLAKE2b-256 checksum How to use checksums |
decd817ff65bf21a010082513575a6537941bf55893f3c3ee9b27b21f8ff8d2d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.0rc1
|
Release files / awareness_sdk-1.0.0-py3-none-any.whl
| Download URL | awareness_sdk-1.0.0-py3-none-any.whl |
|---|---|
| Size | 11.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dfd5243b29ab4c87e9142f96af99fe504c5bf21568f5baeec18d881ac7f6ffcf
|
|
BLAKE2b-256 checksum How to use checksums |
77da3324ef517b1f4e3f0da9e8af01bc8bf2e0a088857f795dcd58dae7ed077d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.0rc1
|
Security for awareness-sdk 1.0.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.