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.2.tar.gz (60.5 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.2-py3-none-any.whl (45.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: socratic_nexus-0.3.2.tar.gz
  • Upload date:
  • Size: 60.5 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.2.tar.gz
Algorithm Hash digest
SHA256 93fd283a99a1fc66395ce02d09c99a6faa322ed35b2ce42921a5c6ffaf95eb9e
MD5 1c575d2062073be81c0373e95d72f2f1
BLAKE2b-256 f00006563d461aeabfd6296d2112a26d7e81443884a12a447d3d6a2e1ac5a3c4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: socratic_nexus-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 45.0 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cad8b4f21f4a2d9949b6da09554c1c33c9fc7a4048726a41d0a89875cc1087c6
MD5 5bddec2d8dc6e3026bc393ce57db7d9e
BLAKE2b-256 45a0f8488811361dd184ad6eb967c5459c3337151298f38535cafbb78714c7f2

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