Skip to main content

A client package to directly integrate Bud Serve engine to your python application.

Project description

Bud Serve Python SDK

A client package to directly integrate Bud Serve engine to your python application. The package support different prompting libraries like Guidance, langchain etc.

Installation

pip install git+https://github.com/BudEcosystem/bud-serve-sdk.git

Supported integrations:

  • Guidance
  • LangChain
  • LlamaIndex
  • Haystack
  • LMQL

Guidance example

Add the API key to the enviornament

export BUDSERVE_API_KEY=XXXXXXXX

Sample code to connect to bud serve remote server using guidance

from guidance import gen, user, system, assistant
from budserve.models.guidance import BudServeClient

llama2 = BudServeClient("meta-llama/Llama-2-7b-chat-hf", echo=False, base_url="http://localhost9000/v1")

with user():
    llama2 += f'what is your name? '

with assistant():
    llama2 += gen("answer", stop='.')


print(llama2["answer"])

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

budserve-0.0.1.tar.gz (6.1 kB view hashes)

Uploaded Source

Built Distribution

budserve-0.0.1-py3-none-any.whl (6.0 kB view hashes)

Uploaded Python 3

Supported by

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