Skip to content

0xTemplar/lilypad-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lilypad Standard Library

Python Version License

The Lilypad Standard Library provides Python tools for interacting with Lilypad's decentralized compute network. Designed for both AI developers and blockchain enthusiasts, it offers seamless integration with LangChain and direct access to Lilypad's core capabilities.

Features

  • 🧠 AI Model Integration: Access cutting-edge models (LLaMA, Mistral, Phi, etc.) through decentralized infrastructure
  • ⛓️ LangChain Compatibility: Use as drop-in replacement for OpenAI clients in existing LangChain workflows
  • 🌐 Dual Interface: Choose between high-level LangChain API or direct low-level client access
  • 🖼️ Multimodal Support: Text generation, image synthesis, and experimental vision-language models
  • 🔍 Job Management: Track compute jobs and retrieve results programmatically

Supported Models

[
    "deepscaler:1.5b", "gemma3:4b", "llama3.1:8b",
    "llava:7b", "mistral:7b", "openthinker:7b",
    "phi4-mini:3.8b", "deepseek-r1:7b", "phi4:14b",
    "qwen2.5:7b", "qwen2.5-coder:7b"
]

Installation

pip install lilypad-sdk

Quick Start

Basic Usage

from lilypad import get_llm

llm = get_llm(model="mistral:7b")
response = llm.invoke("Explain quantum entanglement simply")
print(response.content)

Image Generation

image_bytes = llm.client.generate_image(
    "Cyberpunk frog hacker in neon-lit swamp",
    model="sdxl-turbo"
)
with open("hacker_frog.png", "wb") as f:
    f.write(image_bytes)

LangChain Integration

from langchain_core.prompts import ChatPromptTemplate
from lilypad import get_fast_llm

prompt = ChatPromptTemplate.from_messages([
    ("system", "You are a helpful AI assistant"),
    ("human", "{input}")
])

chain = prompt | get_fast_llm()
print(chain.invoke({"input": "Explain blockchain in pirate terms"}))

Documentation

Full documentation available at docs.lilypad.tech

Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

License

MIT License

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published