avatarLaxfed Paulacy

Summarize

LANGCHAIN — Unifying AI Endpoints with Genoss

Information technology and business are becoming inextricably interwoven. I don’t think anybody can talk meaningfully about one without the talking about the other. — Bill Gates.

In this tutorial, we will explore how to unify AI endpoints using Genoss, powered by LangChain. Genoss offers a universal interface for interacting with GPT models, simplifying the task of integrating and switching between models in your GenAI-powered application. It provides a unified interface for interacting with both Completions and Embeddings models across multiple providers.

The Integration Problem

As new and improved models are introduced, engineers want the freedom to quickly implement new features with these models. However, a gap resides in the current tooling designed to facilitate integrations with LLM providers. Despite the presence of helpful utilities such as LangChain, there is a lack of consistency between model interfaces, making building with LLMs unnecessarily complicated.

Genoss: The Solution

Genoss is a model gateway powered by LangChain that standardizes the process of calling any supported LLM into one unified interface, compatible with the OpenAI API specification. It provides a single cohesive interface for interacting with both Completions and Embeddings models across multiple providers.

Usage in Production

Genoss is open-source and free to use via the hosted version or to self-host on your own infrastructure. It empowers developers to go from a weekend side-project straight to production using the same infrastructure and tech stack. Genoss leverages LangChain’s new tool, LangSmith, which provides observability, debugging, and testing on the inputs and outputs of the models at each stage of the workflow.

Let’s look at how you can use Genoss in your own applications.

from genoss import Genoss
from langsmith import LangSmith

# Initialize Genoss
genoss_client = Genoss(base_url="https://genoss-endpoint-url")

# Perform model call
response = genoss_client.call_model(
    model_name="my_model",
    input_text="Input text for model",
    params={"param1": "value1", "param2": "value2"}
)

# Initialize LangSmith for observability
langsmith_client = LangSmith(base_url="https://langsmith-endpoint-url")

# Perform observability actions
langsmith_client.observe_model_call(
    model_name="my_model",
    input_text="Input text for model",
    output=response
)

In this example, we initialize Genoss and LangSmith clients and then use them to call the model and observe the model call for enhanced observability and analytics in production.

Conclusion

Genoss provides interface unification, reducing the learning curve for developers and organizations scaling applications harnessing the power of Generative AI. It allows developers to test the latest models, experiment with fine-tuning, and run private models locally. Enterprises can use Genoss to control the model usage of their users in both internal and production apps whilst utilizing LangSmith for observability, debugging, and testing.

You can find the code repository for Genoss here. We look forward to seeing what you will build with it.

Langchain
Unifying
AI
Endpoints
ChatGPT
Recommended from ReadMedium