Skip to main content

Universal LLM client for production - works with Claude, GPT-4, Gemini, Llama, and any LLM. Built-in integrations with Openclaw and LangChain.

Project description

Socratic Nexus (socrates-nexus)

Universal LLM abstraction layer providing unified access to multiple AI providers

Overview

socrates-nexus is a specialized component of the Socratic ecosystem that provides comprehensive functionality for universal llm abstraction layer providing unified access to multiple ai providers. It offers a production-ready, well-tested solution for integrating into larger Socratic systems.

Key Features

  • Multi-provider support
  • Unified client interface
  • Async/sync API support
  • Model standardization

Installation

Prerequisites

  • Python 3.8+
  • pip or poetry package manager

Via pip

pip install socrates-nexus

Via poetry

poetry add socrates-nexus

From source

git clone https://github.com/socratic-ai/socrates-nexus.git
cd socrates-nexus
pip install -e .

Quick Start

Basic Usage

from socrates_nexus import Client

# Initialize the component
client = Client()

# Perform basic operation
result = client.process()
print(result)

Configuration

from socrates_nexus import Client

# Configure with custom settings
client = Client(
    api_key="your-api-key",
    model="claude-3-5-haiku",
    timeout=30
)

# Use the client
response = client.query("What is the essence of learning?")

Core Components

  • Client: Main interface for interacting
  • Providers: Provider-specific implementations
  • Models: Model definitions and configurations
  • Async Client: Asynchronous version
  • Exceptions: Custom error handling

Architecture Overview

socrates-nexus follows a modular, layered architecture:

  • Client Layer: Public API for external consumers
  • Processing Layer: Core business logic and algorithms
  • Integration Layer: Connections to external services and APIs
  • Data Layer: State management and data persistence

Integration with Socratic Ecosystem

socrates-nexus integrates seamlessly with:

  • socrates-nexus: Unified LLM provider interface
  • socratic-rag: Knowledge retrieval and augmentation
  • socratic-core: Common utilities and base classes
  • Other ecosystem components: As needed for specific use cases

Dependencies

- anthropic
- openai
- google-generativeai
- langchain

Performance Considerations

  • Caching: Intelligent caching for frequently accessed data
  • Async Support: Full async/await support for non-blocking I/O
  • Scalability: Designed for high-concurrency scenarios
  • Resource Efficiency: Optimized memory and CPU usage

Error Handling

The library provides comprehensive error handling:

from socrates_nexus import Client, Error

try:
    client = Client()
    result = client.process()
except Error as e:
    print(f"Error: {e}")

Testing

Run the test suite:

pytest tests/

With coverage reporting:

pytest --cov=socrates_nexus tests/

API Reference

For complete API documentation, see ARCHITECTURE.md

Contributing

Contributions are welcome! See CONTRIBUTING.md for guidelines.

Support & Resources

License

MIT License - See LICENSE file for details


Part of the Socratic Ecosystem

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

socratic_nexus-0.3.4.tar.gz (66.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

socratic_nexus-0.3.4-py3-none-any.whl (49.4 kB view details)

Uploaded Python 3

File details

Details for the file socratic_nexus-0.3.4.tar.gz.

File metadata

  • Download URL: socratic_nexus-0.3.4.tar.gz
  • Upload date:
  • Size: 66.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for socratic_nexus-0.3.4.tar.gz
Algorithm Hash digest
SHA256 9c5683b4190ea25a65542aad0598b872acb82f671c7d07676b35bb609a09ef1e
MD5 2f42ae0d39a539883994728949bb8108
BLAKE2b-256 9e1e70f4c867aa903d3b52fbf6b88e0888ea1b5b61c7108f92b07b4bdaa81f8f

See more details on using hashes here.

File details

Details for the file socratic_nexus-0.3.4-py3-none-any.whl.

File metadata

  • Download URL: socratic_nexus-0.3.4-py3-none-any.whl
  • Upload date:
  • Size: 49.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for socratic_nexus-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 acb3721cbe706ba25cc929022117fa5ca0647b73c7181f2cc58c4d9cdbef34a8
MD5 75754f1b03f6fd57a4186baceec1cccc
BLAKE2b-256 e1e0f9480720d85c9644c4887139ae9429239a8aac2ea0b3d9b274225971c533

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page