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 the 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 — call directly
meta-llama/Llama-3.1-70B-Instruct 128k On-demand — deploy first
Qwen/Qwen2.5-Coder-32B-Instruct 32k On-demand — deploy first

DeepSeek-R1-Distill-Qwen-7B is the always-on model returned by GET https://api.silvol.ai/v1/models — call it directly. Other models are served on demand: provision a dedicated GPU deployment first (from the dashboard or the deployments API), then call it by the HuggingFace model ID you deployed.


Authentication

Get your API key from the Silvol Dashboard. Keys are prefixed sk-svl-. Pass it as api_key=, or set the SILVOL_API_KEY environment variable (the SDK reads it automatically). OPENAI_API_KEY also works as a fallback.


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.1.tar.gz (9.5 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.1-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: silvol-0.2.1.tar.gz
  • Upload date:
  • Size: 9.5 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.1.tar.gz
Algorithm Hash digest
SHA256 1706f5fcc19137c6aa220126655a617dbaee37ba3457b0c15b0f553d34d7ec4d
MD5 32514d55ffd0140a9fd76b7175a480a7
BLAKE2b-256 4f250fb63725031dfb288f4a525993e7d2ce3b258ae6fea902912b1ccff1d143

See more details on using hashes here.

Provenance

The following attestation bundles were made for silvol-0.2.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: silvol-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 10.3 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 11434e403465895d633084391a0017583d70fa0a1f683fa2dfb242711f8de84e
MD5 9cbeeb53107c9318a11140a82cfd9fb9
BLAKE2b-256 71c77690aa81605861c23b7e8194ce2b671da81fe18d61b49371f48f90b1ecc4

See more details on using hashes here.

Provenance

The following attestation bundles were made for silvol-0.2.1-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