Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Python SDK for OpenGradient decentralized model management & inference services
Python SDK for the OpenGradient platform provides decentralized model management & inference services. Python SDK allows programmatic access to our model repository and decentralized AI infrastructure.
To install Python SDK and CLI, run the following command:
pip install opengradient
To get started, run:
import opengradient as og
og.init(private_key="<private_key>", email="<email>", password="<password>")
The following commands show how to use Python SDK.
og.create_model(model_name="<model_name>", model_desc="<model_description>")
og.create_model(model_name="<model_name>", model_desc="<model_description>", model_path="<model_path>")
og.create_version(model_name="<model_name>", notes="<model_notes>")
og.upload(model_path="<model_path>", model_name="<model_name>", version="<version>")
og.list_files(model_name="<model_name>", version="<version>")
inference_mode = og.InferenceMode.VANILLA
og.infer(model_cid, model_inputs, inference_mode)
VANILLA
, ZKML
, or TEE
tx_hash, response = og.llm_completion(
model_cid='meta-llama/Meta-Llama-3-8B-Instruct',
prompt="Translate the following English text to French: 'Hello, how are you?'",
max_tokens=50,
temperature=0.0
)
# create messages history
messages = [
{
"role": "system",
"content": "You are a helpful AI assistant.",
"name": "HAL"
},
{
"role": "user",
"content": "Hello! How are you doing? Can you repeat my name?",
}]
# run LLM inference
tx_hash, finish_reason, message = og.llm_chat(
model_cid=og.LLM.MISTRAL_7B_INSTRUCT_V3,
messages=messages
)
export OPENGRADIENT_EMAIL="<email>"
export OPENGRADIENT_PASSWORD="<password>"
opengradient create_model_repo "<model_name>" "<description>"
v0.01
opengradient create_model_repo "<model_name>" "<description>"
opengradient upload "<model_path>" "<model_name>" "<version>"
opengradient list_files "<model_name>" "<version>"
opengradient infer QmbUqS93oc4JTLMHwpVxsE39mhNxy6hpf6Py3r9oANr8aZ VANILLA '{"num_input1":[1.0, 2.0, 3.0], "num_input2":10, "str_input1":["hello", "ONNX"], "str_input2":" world"}'
opengradient infer QmbUqS93oc4JTLMHwpVxsE39mhNxy6hpf6Py3r9oANr8aZ VANILLA --input_file input.json
We also have explicit support for using LLMs through the completion and chat commands in the CLI.
For example, you can run a competion inference with Llama-3 using the following command:
opengradient completion --model "meta-llama/Meta-Llama-3-8B-Instruct" --prompt "hello who are you?" --max-tokens 50
Or you can use files instead of text input in order to simplify your command:
opengradient chat --model "mistralai/Mistral-7B-Instruct-v0.3" --messages-file messages.json --tools-file tools.json --max-tokens 200
For more information read the OpenGradient documentation.
FAQs
Python SDK for OpenGradient decentralized model management & inference services
We found that opengradient demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.