这是indexloc提供的服务,不要输入任何密码
Skip to content

Add support for OpenAI Batch API #405

@0xdevalias

Description

@0xdevalias

The Batch API provides a 50% discount on token costs, and higher rate limits; with the downside being that the results aren't available straight away (could be up to 24hr delay).

I think for a lot of JS reversing use cases, these tradeoffs of cost/benefit would likely make enough sense to explore implementing.

  • https://platform.openai.com/docs/guides/batch
    • While some uses of the OpenAI Platform require you to send synchronous requests, there are many cases where requests do not need an immediate response or rate limits prevent you from executing a large number of queries quickly. Batch processing jobs are often helpful in use cases like:

      • Running evaluations
      • Classifying large datasets
      • Embedding content repositories

      The Batch API offers a straightforward set of endpoints that allow you to collect a set of requests into a single file, kick off a batch processing job to execute these requests, query for the status of that batch while the underlying requests execute, and eventually retrieve the collected results when the batch is complete.

      Compared to using standard endpoints directly, Batch API has:

      • Better cost efficiency: 50% cost discount compared to synchronous APIs
      • Higher rate limits: Substantially more headroom compared to the synchronous APIs
      • Fast completion times: Each batch completes within 24 hours (and often more quickly)
  • https://platform.openai.com/docs/pricing

See Also

This would potentially also have relevance to the stable renaming / resumability / etc issues; as I suspect there may be a need to export some kind of ‘status’ file that might contain a hash of the source file + extract of the scopes + identifier names or similar:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions