A Python library that interfaces with Llama LLM for various operations
Project description
SimpleVibe
A vibe coded AI powered isOdd tool <3 Bonus: vibify()
Features
- Two inference modes:
- Local Mode: Run Llama directly on your machine (requires more resources)
- Remote Mode: Connect to a remote Llama API (lightweight)
- Flexible backend selection:
- Choose at install time with
pip install simplevibe(remote) orpip install simplevibe[local](local) - Override at runtime with environment variable
SIMPLEVIBE_BACKEND=remote|local - Set programmatically with
simplevibe.set_backend('remote'|'local')
- Choose at install time with
- LLM-powered functions:
oddVibes(): Determine if a number is odd with AIvibify(): Enhance the vibes of text using LLM
- Simple command-line interface
Installation
You can install simpleVibe in two different modes:
Remote Mode (Default)
This mode uses a remote API for inference and has minimal dependencies:
pip install simplevibe
Local Mode
This mode runs inference locally on your machine and requires additional dependencies:
pip install simplevibe[local]
Note: Local mode requires more computational resources but doesn't need an internet connection or API access.
Forcing a Specific Backend
By default, simpleVibe will use the local backend if its dependencies are available, otherwise it will use the remote backend. You can override this behavior in two ways:
Using an Environment Variable
# Force remote backend even if local dependencies are installed
export SIMPLEVIBE_BACKEND=remote
python your_script.py
# Force local backend (will fall back to remote if dependencies are missing)
export SIMPLEVIBE_BACKEND=local
python your_script.py
Using the API
import simplevibe
# Force remote backend for future client creations
simplevibe.set_backend('remote')
# Create a client (will use remote backend)
client = simplevibe.create_client()
Usage
As a library
from simplevibe.core import oddVibes, vibify
from simplevibe import get_backend_type, set_backend
# Optional: Override the backend (use 'local' or 'remote')
# set_backend('remote')
# Check which backend is being used (local or remote)
print(f"Using {get_backend_type()} backend")
# Use AI powered tool to check if a number is odd
result = oddVibes(42)
print(f"Is 42 odd? {result}") # Is 42 odd? False
# Enhance the vibes of some text
enhanced = vibify("That's really cool")
print(enhanced) # That's straight fire, no cap
Direct API Access
For more control, you can directly use the raw llama3 function:
# Import the raw llama3 function
from simplevibe import llama3
# Call the API directly with custom parameters
response = llama3(
messages=[
{"role": "system", "content": "You are an AI assistant that speaks like a pirate."},
{"role": "user", "content": "Tell me about the weather today."}
],
temperature=0.8,
max_new_tokens=150,
url="http://127.0.0.1:42070" # Change to your API server
)
# Access the response
print(response['result']) # Raw result from the API
Advanced: Using Images with the API
You can also pass images to the API for multimodal capabilities:
from simplevibe import llama3
# Call the API with an image
response = llama3(
messages=[
{"role": "user", "content": "What can you see in this image?"}
],
image_paths="path/to/your/image.jpg",
max_new_tokens=500
)
# Handle multiple images
response = llama3(
messages=[
{"role": "user", "content": "Compare these two images."}
],
image_paths=["path/to/image1.jpg", "path/to/image2.jpg"],
upload_files=True # Set to False if the server has access to these paths
)
print(response['result'])
From the command line
After installation, you can use the simplevibe command:
# Show the greeting
simplevibe
# Check if a number is odd
simplevibe oddVibes 42
# Enhance the vibes of some text
simplevibe vibify "This is really interesting"
# Display information about the current backend
simplevibe info
# Set preferred backend (persists for current terminal session)
simplevibe set-backend remote
simplevibe set-backend local
Requirements
- Python 3.7 or higher
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file simplevibe-0.1.2.tar.gz.
File metadata
- Download URL: simplevibe-0.1.2.tar.gz
- Upload date:
- Size: 13.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c50f02260e9110d1708966cd8b21045719e88d9cfd0e192a563c66dca0a1461f
|
|
| MD5 |
b5f7c0bc554e119c8b022b7e8ca0bc3e
|
|
| BLAKE2b-256 |
56510012fdd98ba214ae0bcd0b00fe76da99381d3fc22819be58bf7227b21854
|
File details
Details for the file simplevibe-0.1.2-py3-none-any.whl.
File metadata
- Download URL: simplevibe-0.1.2-py3-none-any.whl
- Upload date:
- Size: 12.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ca00b0146a6c3924cf9c7cd3d7a205977cd6578ff908472adac449da878b1aa
|
|
| MD5 |
d86f0707ad9c4a9f1e5e6641d6ea2f25
|
|
| BLAKE2b-256 |
34bdf7f4102e6e4a01c99dc11023b4b94a72fc7ddf1f83da108af668c0a660b3
|