Metadata-Version: 2.4
Name: bridgenode-llm
Version: 0.2.0
Summary: BridgeNode SDK — AI inference per request, mokėjimas Solana USDC per x402. Gasless: facilitator dengia SOL dujas.
Author: BridgeNode
License: Apache-2.0
Keywords: x402,solana,usdc,ai,llm,agent,pay-per-request
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.27
Requires-Dist: solders>=0.28
Requires-Dist: base58>=2.1
Provides-Extra: svm
Requires-Dist: solana<0.37,>=0.36; extra == "svm"

# bridgenode-llm

BridgeNode SDK — AI inference per request. Mokėjimas Solana USDC per x402 V2.
**Gasless:** facilitatoris dengia SOL dujas — agentui nereikia SOL.

- OpenAI-compatible endpoint
- Automatinis x402 handshake: 402 → pasirašyti dalinį TX → retry
- Kvito (PAYMENT-RESPONSE) verifikacija po kiekvieno mokėjimo
- Spending policy: max/call ir daily cap (fail-closed)
- Jokių interaktyvių promptų — SDK skirtas agentams

## Įdiegimas

```bash
pip install bridgenode-llm
```

## Konfigūracija (.env)

```bash
BRIDGENODE_WALLET_KEY=<agento Solana wallet private key>   # agento USDC signing
BRIDGENODE_BASE_URL=https://bridgenode.cc/v1               # optional
BRIDGENODE_MAX_PER_CALL=0.05                               # optional, USDC
BRIDGENODE_DAILY_CAP=1.0                                   # optional, USDC
```

## Naudojimas

```python
from bridgenode_llm import LLMClient

client = LLMClient()  # raktas iš .env (BRIDGENODE_WALLET_KEY)

# Explicit model
response = client.chat("deepseek-v4-flash", "Hello!")

# Smart routing (mode: auto | eco | premium)
response = client.chat(mode="auto", messages=[{"role": "user", "content": "Write code"}])

print(response["choices"][0]["message"]["content"])
```

Detalės: protokolas.md §8.4 (BridgeNode protokolas).
