Skip to main content

Python SDK for the Silvol inference API — OpenAI-compatible, decentralised GPU.

Project description

silvol-python

Python SDK for Silvol — 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

pip install silvol

With optional framework integrations:

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

Quickstart

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:

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

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

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. Keys are prefixed sk-svl-. Pass it as api_key= or set the OPENAI_API_KEY environment variable (the SDK checks it automatically).


Links

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

silvol-0.2.0.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

silvol-0.2.0-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file silvol-0.2.0.tar.gz.

File metadata

  • Download URL: silvol-0.2.0.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for silvol-0.2.0.tar.gz
Algorithm Hash digest
SHA256 e82f670d9ac1ea7182e04854f7472444e8973a061c88cc47cbd3af1c530d0a8b
MD5 40cfaef6cc85e9c2c42e0b0365bf70ce
BLAKE2b-256 bb4cd5b945671dc4d7be2bcd3d8dfba710fc93fea5f9128336cab7661971c298

See more details on using hashes here.

Provenance

The following attestation bundles were made for silvol-0.2.0.tar.gz:

Publisher: publish.yml on optimuscodexprimus/silvol-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file silvol-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: silvol-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for silvol-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 86ae52d14f490b34838bcc585f148ba1e7755bf1c09373dea144e73f04bc562c
MD5 6a902f700c861876b7b97313ab201c76
BLAKE2b-256 0736242eeb27fce333c56532c009409c9fdb49c9e2cd567e80f501924d776bf8

See more details on using hashes here.

Provenance

The following attestation bundles were made for silvol-0.2.0-py3-none-any.whl:

Publisher: publish.yml on optimuscodexprimus/silvol-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page