Skip to main content

FlagEval Serving

Serving Framework of AI Models for Evaluating on FlagEval Platform.

Installation

pip install --upgrade flageval-serving

Usage

  1. Model: of course we have a model that is ready be evaluated, let's assume it lives in the path: /path/to/model;

  2. Then we can write our service code, let's put the service code in service.py or './tests/service.py' and take a NLP model as the example:

    from flageval.serving.service import NLPModelService, NLPEvalRequest, NLPEvalResponse, NLPCompletion
    
    
    class DemoService(NLPModelService):
        def global_init(self, model_path: str):
            print("Initial model with path", model_path)
    
        def infer(self, req: NLPEvalRequest) -> NLPEvalResponse:
            return NLPEvalResponse(
                completions=[
                    NLPCompletion(
                        text='Hello, world!',
                        tokens='Hello, world!',
                    ),
                ]
            )
    
  3. Finally, we use the flageval-serving command to serve:

    flageval-serving --service service:DemoService dev /path/to/model  # start a development server
    flageval-serving --service service:DemoService run /path/to/model  # start a production server
    

Dockerfile

FlagEval evaluation platform construction image

Metadata

Release files for flageval-serving 0.2.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flageval-serving 0.2.5
File Size Uploaded Provenance Actions
flageval_serving-0.2.5.tar.gz 12.2 kB Without provenance Details for flageval_serving-0.2.5.tar.gz

Release files / flageval_serving-0.2.5.tar.gz

Download URL flageval_serving-0.2.5.tar.gz
Size 12.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c8869fa3db954fd93d1499d3be90ba0c541b025f196f55b0283049f269d694c8
BLAKE2b-256 checksum
How to use checksums
77f6347ad3d04567708e44d158d9536df1bfa86dc03c8b1d4a55739a3da69fd0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.7

Security for flageval-serving 0.2.5

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