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.3.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.3-py3-none-any.whl (49.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: socratic_nexus-0.3.3.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.3.tar.gz
Algorithm Hash digest
SHA256 4ac3fa34960e06c073f7a9fdb21fb1f6bb7795d5852bcb239912a2ae314d59c2
MD5 d2a1099c5ceee6296c6ba8ee56511225
BLAKE2b-256 262e585eaab64b872cde2d42b954fed785b7cb01d6a86c4d70187897c1e67a67

See more details on using hashes here.

File details

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

File metadata

  • Download URL: socratic_nexus-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 49.3 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e92da2d56468e7e2fb8e14d53070b03cd79c6699d7af8c30575035c8c568e8aa
MD5 7e2b824f6a86f761ce8b6a2d044fe9a9
BLAKE2b-256 27909b306d43ffb3a4d5ab4e358735394c5d7affb5c6cc8d19289f4274fdfdd4

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