bce-qianfan-sdk  by baidubce

SDK for Baidu's Qianfan LLM platform, enabling AI workflows

created 1 year ago
371 stars

Top 77.6% on sourcepulse

GitHubView on GitHub
Project Summary

The Qianfan SDK provides Python bindings for Baidu's Qianfan MaaS platform, enabling developers to integrate large language model (LLM) inference, training, and management into their AI workflows and applications. It offers a streamlined interface for tasks like chat, text completion, embeddings, and image generation, as well as end-to-end LLM fine-tuning and pre-training.

How It Works

The SDK abstracts the complexities of the Qianfan platform, offering a unified Python API. For inference, it supports various models (ERNIE series, open-source) with options for chat, completion, and embeddings, including asynchronous, streaming, and batch processing. For training, it provides a pipeline-based approach for data preparation (Dataset module), fine-tuning/pre-training (Trainer module), and model management (Model module), allowing customization of LLMs for specific business needs.

Quick Start & Requirements

  • Install: pip install 'qianfan[dataset_base]'
  • Prerequisites: Python 3.7.0+. Requires Baidu Cloud Access Key and Secret Key for full functionality (training, model management); API Key/Secret Key can be used for inference-only.
  • Setup: Obtain credentials from the Baidu Smart Cloud console.
  • Docs: Platform Documentation

Highlighted Details

  • Supports chat, completion, embeddings, text-to-image, image-to-text, and reranking.
  • End-to-end LLM training pipeline: Dataset preparation, Trainer for fine-tuning/pre-training, Model management.
  • Dataset module allows local data manipulation and uploading to the platform.
  • Includes Prompt management and a command-line interface (CLI) for direct platform interaction.

Maintenance & Community

  • Contact via GitHub issues, Baidu Smart Cloud tickets, or the official Qianfan SDK WeChat group.

Licensing & Compatibility

  • License: Apache-2.0.
  • Compatible with commercial use and closed-source linking.

Limitations & Caveats

  • API Key/Secret Key authentication is deprecated and will be removed; Access Key/Secret Key is recommended for full feature access, including training and model management.
  • Dynamic model list retrieval requires IAM Access Key authentication; application AK authentication does not support this.
Health Check
Last commit

1 month ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
0
Star History
5 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.