Metadata-Version: 2.4
Name: silvol
Version: 0.2.0
Summary: Python SDK for the Silvol inference API — OpenAI-compatible, decentralised GPU.
Project-URL: Homepage, https://silvol.ai
Project-URL: Documentation, https://silvol.ai/docs
Project-URL: Repository, https://github.com/optimuscodexprimus/silvol-python
Project-URL: Bug Tracker, https://github.com/optimuscodexprimus/silvol-python/issues
Author-email: Silvol <hello@silvol.ai>
License: MIT License
        
        Copyright (c) 2026 Silvol
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: gpu,inference,llm,nosana,openai,silvol
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Requires-Dist: httpx>=0.25
Requires-Dist: openai>=1.0
Provides-Extra: all
Requires-Dist: crewai>=0.30; extra == 'all'
Requires-Dist: langchain-openai>=0.1; extra == 'all'
Provides-Extra: crewai
Requires-Dist: crewai>=0.30; extra == 'crewai'
Provides-Extra: dev
Requires-Dist: build; extra == 'dev'
Requires-Dist: pytest>=7; extra == 'dev'
Requires-Dist: twine; extra == 'dev'
Provides-Extra: langchain
Requires-Dist: langchain-openai>=0.1; extra == 'langchain'
Description-Content-Type: text/markdown

# silvol-python

Python SDK for [Silvol](https://silvol.ai) — an OpenAI-compatible inference API running on
Nosana's decentralised GPU grid.

Drop-in replacement for the OpenAI SDK. Change the base URL and your key; keep the rest
of your code.

---

## Install

```bash
pip install silvol
```

With optional framework integrations:

```bash
pip install silvol[langchain]   # LangChain
pip install silvol[crewai]      # CrewAI
pip install silvol[all]         # both
```

---

## Quickstart

```python
from silvol import Silvol

client = Silvol(api_key="sk-svl-...")          # or set SILVOL_API_KEY env var

resp = client.chat.completions.create(
    model="DeepSeek-R1-Distill-Qwen-7B",
    messages=[{"role": "user", "content": "Hello"}],
)
print(resp.choices[0].message.content)
```

Async:

```python
import asyncio
from silvol import AsyncSilvol

async def main():
    client = AsyncSilvol(api_key="sk-svl-...")
    resp = await client.chat.completions.create(
        model="DeepSeek-R1-Distill-Qwen-7B",
        messages=[{"role": "user", "content": "Hello"}],
        stream=True,
    )
    async for chunk in resp:
        print(chunk.choices[0].delta.content or "", end="", flush=True)

asyncio.run(main())
```

---

## LangChain

```python
from silvol.integrations.langchain import SilvolChat

llm = SilvolChat(api_key="sk-svl-...")
result = llm.invoke("Summarise the Silvol architecture in one sentence.")
print(result.content)
```

---

## CrewAI

```python
from silvol.integrations.crewai import SilvolLLM
from crewai import Agent, Task, Crew

llm = SilvolLLM(api_key="sk-svl-...")

researcher = Agent(
    role="Senior Researcher",
    goal="Uncover groundbreaking technologies in AI",
    backstory="...",
    llm=llm,
)
```

---

## Models

| Model ID | Context | Notes |
|---|---|---|
| `DeepSeek-R1-Distill-Qwen-7B` | 32k | Always-on (free tier) |
| `llama-3.1-70b` | 128k | On-demand deployment |
| `qwen-2.5-coder-32b` | 32k | On-demand deployment |

Full list: `GET https://api.silvol.ai/v1/models`

---

## Authentication

Get your API key from the [Silvol Dashboard](https://silvol.ai/dashboard).
Keys are prefixed `sk-svl-`. Pass it as `api_key=` or set the `OPENAI_API_KEY`
environment variable (the SDK checks it automatically).

---

## Links

- Docs: [silvol.ai/docs](https://silvol.ai/docs)
- Dashboard: [silvol.ai/dashboard](https://silvol.ai/dashboard)
- PyPI: [pypi.org/project/silvol](https://pypi.org/project/silvol)
- GitHub: [github.com/optimuscodexprimus/silvol-python](https://github.com/optimuscodexprimus/silvol-python)
