Metadata-Version: 2.2
Name: esotericai
Version: 0.0.1
Summary: Efficient distributed inference.
Home-page: https://github.com/esoteric-ai/esoteric-ai
Author: esoteric-ai
Author-email: kiselev.sereja@gmail.com
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx
Requires-Dist: websockets
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# example_usage.py
import asyncio
import time
from esotericai.circuit import CircuitForBatchProcessing

async def task(circuit, id):
    conv = [
        {
            "role": "user",
            "content": f"Hello! Please use number {id} in your responce."  
        }
    ]
    result = await circuit.chat(["llama8b"], conv)
    print(f"Task {id}/1 done:" + str(result))

start_time = time.time()

CircuitForBatchProcessing.dispatch(
        job_name="my_chat_job",
        task_func=task,
        num_tasks=5,
        api_url="127.0.0.1:6325"  # Nexus IP adress
)

end_time = time.time()

print(f"Total time taken: {end_time - start_time:.2f} seconds")
