Skip to main content

ModelSonic Python Client

This is a Python client for the ModelSonic APIs.

Installation

Use the package manager pip to install python-modelsonic.

pip install python-modelsonic

Usage

from modelsonic.client import ModelSonicClient
from modelsonic.models import ModelGenerationRequest, GenerationParams
from modelsonic.enums import ModelsEnum, ProvidersEnum


client = ModelSonicClient(base_url='your_base_url', api_key='your_api_key')

messages = [
    {"role": "user", "content": "Write me a short poem"},
]
prompt_params = GenerationParams(messages=messages)
claude2_request = ModelGenerationRequest(
    model_name=ModelsEnum.CLAUDE_INSTANT_12,
    provider_name=ProvidersEnum.ANTHROPIC.value,
    order=1,
    prompt_params=prompt_params,
)

response = client.generate(ordered_generation_requests=[claude2_request])
print(response.choices[0].text)

Remember to replace 'your_base_url' and 'your_api_key' with your actual base URL and API key when using the client.

Metadata

Release files for python-modelsonic 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 python-modelsonic 0.1.0
File Size Uploaded Provenance Actions
python-modelsonic-0.1.0.tar.gz 15.8 kB Without provenance Details for python-modelsonic-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 32.2 kB

Release files / python-modelsonic-0.1.0.tar.gz

Download URL python-modelsonic-0.1.0.tar.gz
Size 15.8 kB
Tags Source
SHA-256 checksum
How to use checksums
fd4dab6b34e9462564f52af5dc03ea62e949e9d34e60b8b582ed3ac985652f4a
BLAKE2b-256 checksum
How to use checksums
a2f9e00deafb48c47b6a0b2e4c5b130da2faacb9e5bd98bd2fd759279ac5159d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

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

Download URL python_modelsonic-0.1.0-py3-none-any.whl
Size 16.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
25ae46f049a4be9bafc87692f71559fa50075cd7eb256a1e87b52c6f1da0474e
BLAKE2b-256 checksum
How to use checksums
b28fa5413d38d4af8c9a8769f8f8c83ff704a3dc89531bc08fc19467620c36e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Security for python-modelsonic 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.

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