Skip to content

Easy ways to prompt LLMs on collections of prompts. Intended to speed up research experiments.

Notifications You must be signed in to change notification settings

zohaib-khan5040/smolprompter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

smolprompter

I got annoyed with dealing with so many different interfaces for interacting with models through APIs. I wanted something convenient to use for myself.

This is a work in progress. To be clear, I'm aware that aisuite exists but I just wanted something I could tune for myself since I tend to use the same idioms and approaches over and over.

I plan to add on interfaces for more providers, to address more functionality like generating Embeddings or Text-to-Image, and refactoring.

Example Usage

import os
from smolprompter import ChatClient, OpenAIClient, CohereClient
from dotenv import load_dotenv

# Load environment variables from the .env file
load_dotenv('.env', override=True)

# Initialize the clients
openai_client = OpenAIClient(os.getenv("OPENAI_API_KEY"))
cohere_client = CohereClient(os.getenv("COHERE_API_KEY"))

# Define the message payload for the model
messages=[
    {"role": "user", "content": "What do they call a Quarter Pounder with cheese in Paris?"}
]

# Call the model's get_response method to generate the response
openai_resp = openai_client.get_response(
    model="gpt-4o",
    messages=messages
)
cohere_resp = cohere_client.get_response(
    model="c4ai-aya-expanse-8b",
    messages=messages
)


# Output the response content
print(resp['content'])

About

Easy ways to prompt LLMs on collections of prompts. Intended to speed up research experiments.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages