Skip to main content

IsoZero: Enhancing LLM Zero-Shot Responses

IsoZero is a powerful SDK designed to enhance Large Language Model (LLM) zero-shot responses through multi-step reasoning and document analysis. By leveraging a step-by-step reasoning process, this SDK helps improve the accuracy and depth of LLM outputs, especially in scenarios where the model hasn't been specifically fine-tuned for the task at hand.

Features

  • Multi-step reasoning process to break down complex tasks
  • Support for multiple LLM backends:
    • Claude (Anthropic)
    • GPT (OpenAI)
    • Transformer models (Hugging Face)
  • Document analysis capabilities for context-aware responses
  • Mathematical problem-solving simulation
  • Flexible CLI with progress bars and result saving
  • Customizable number of reasoning steps

Package Structure

The IsoZero package consists of two main modules:

  1. reason_sim: General reasoning and document analysis
  2. math_sim: Mathematical problem-solving simulation

Installation

Install IsoZero directly from PyPI:

pip install isozero

For the latest development version:

pip install git+https://github.com/iso-ai/isozero.git

Usage

Command Line Interface

IsoZero provides a flexible CLI for various tasks:

  1. General Reasoning Task:

    isozero --mode reasoning --task "Explain the process of photosynthesis" --agent claude --steps 4 --save
    
  2. Document Analysis (Question Answering):

    isozero --mode qa --documents https://en.wikipedia.org/wiki/Artificial_intelligence https://en.wikipedia.org/wiki/Machine_learning --questions questions.txt --agent huggingface --model google/flan-t5-large --steps 4
    
  3. Math Problem Solving:

    isozero --mode math --task "A train travels at 60 km/h for 2 hours, then at 90 km/h for 3 hours. What's the total distance?" --agent openai --steps 4 --save
    

The --save flag will store the results in a JSON file in the logs folder.

Python API

You can also use IsoZero in your Python scripts:

from isozero.reason_sim import ClaudeAgent, QuestionAnswerer, DocumentLoader
from isozero.reason_sim.reason_simulation import ReasonSimulation
from isozero.reason_sim.simulation_wrapper import SimulationWrapper

# Initialize the agent
agent = ClaudeAgent(api_key="your_api_key_here")

# For reasoning tasks
simulation = ReasonSimulation("Explain the process of photosynthesis", max_steps=4)
wrapper = SimulationWrapper(agent, simulation)

for step in range(4):
    state = wrapper.step()
    print(f"Step {state['text_data']['step']}:", state['text_data']['reasoning'][-1])

# For document analysis
loader = DocumentLoader()
documents = loader.load(["path/to/document.txt"])
qa = QuestionAnswerer(agent)
results = qa.answer_questions(documents, ["Your question here"])

Configuration

Set environment variables for API keys:

export ANTHROPIC_API_KEY=your_anthropic_key_here
export OPENAI_API_KEY=your_openai_key_here

Or use a .env file in your project root.

License

This project is licensed under the Apache License, Version 2.0. See the LICENSE file for details.

Citation

If you use IsoZero in your research, please cite it as follows:

@software{isozero2024,
  author = {Jazmia Henry},
  title = {IsoZero: Enhancing LLM Zero-Shot Responses},
  year = {2024},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/iso-ai/isozero}}
}

Metadata

Release files for isozero 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for isozero 0.1.0
File Size Uploaded Provenance Actions
isozero-0.1.0.tar.gz 18.8 kB Without provenance Details for isozero-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for isozero 0.1.0
File Interpreter ABI Platform Actions
isozero-0.1.0-py3-none-any.whl Python 3 none any Details for isozero-0.1.0-py3-none-any.whl

Total release size: 44.3 kB

Release files / isozero-0.1.0.tar.gz

Download URL isozero-0.1.0.tar.gz
Size 18.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e54e423fd096e385e199ee4fc3f143b11455587e122e5061638aa834a1f4569b
BLAKE2b-256 checksum
How to use checksums
3d74ac22b61b839b1d13133b252639fb0f6e60a7f562e3aa01ab39f607d3aa3a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.6

Release files / isozero-0.1.0-py3-none-any.whl

Download URL isozero-0.1.0-py3-none-any.whl
Size 25.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
579b4f7517159186a286ece22a8b923b472ffff3eb26ee6d5b2b4ea4aa48a509
BLAKE2b-256 checksum
How to use checksums
840ceeeee5f743282f3f1abfc5f231e32158e315d843308891077f28a8df7679
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.6

Security for isozero 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page