Skip to main content

Wrappers around LLM API models and embeddings clients.

Project description

Langchain LLM API

A Langchain compatible implementation which enables the integration with LLM-API

The main reason for implementing this package is to be able to use Langchain with any model run locally.

Usage

You can install this as a python library using the command (until it's integrated with langchain itself)

pip install langchain-llm-api

To use this langchain implementation with the LLM-API:

from langchain_llm_api import LLMAPI, APIEmbeddings

llm = LLMAPI(
    params={"temp": 0.2},
    verbose=True
)

llm("What is the capital of France?")

Or with streaming:

from langchain_llm_api import LLMAPI, APIEmbeddings
from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler

llm = LLMAPI(
    params={"temp": 0.2},
    verbose=True,
    streaming=True,
    callback_manager=CallbackManager([StreamingStdOutCallbackHandler()])
)

llm("What is the capital of France?")

Check LLM-API for the possible models and thier params

Embeddings

to use the embeddings endpoint:

emb = APIEmbeddings(
    host_name="your api host name",
    params = {"n_predict": 300, "temp": 0.2, ...}
)

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

langchain_llm_api-0.0.1.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

langchain_llm_api-0.0.1-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file langchain_llm_api-0.0.1.tar.gz.

File metadata

  • Download URL: langchain_llm_api-0.0.1.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.8.16 Linux/5.15.0-1035-azure

File hashes

Hashes for langchain_llm_api-0.0.1.tar.gz
Algorithm Hash digest
SHA256 14fcb392805691022ab4274189515866bf1bb9fc58eb90803a468ea31f799015
MD5 2b1cb6bbffe02deaa010a36129002c71
BLAKE2b-256 b4ddd45b26379aa1fba996064071a31adeb2393e50f2f74d5e82817d34659e32

See more details on using hashes here.

File details

Details for the file langchain_llm_api-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: langchain_llm_api-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.8.16 Linux/5.15.0-1035-azure

File hashes

Hashes for langchain_llm_api-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bb46a951251b448429db98ece1f6cf609103a11e38dd8d73c000244a0485462d
MD5 24ea18de31f623cb9e452e177e635ffd
BLAKE2b-256 6bcd79526ec075e366576f87d397e1cf636da88a7dc03e026e6bed21ad72d004

See more details on using hashes here.

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