Git Product home page Git Product logo

Comments (2)

Issues-translate-bot avatar Issues-translate-bot commented on August 16, 2024

Bot detected the issue body's language is not English, translate it automatically.


Title: I hope to add an option to disable the model, because gpt4 is too expensive and does not want to be called by users in some situations.

Checklist

  • I believe this idea is great and will make the framework better
  • I have searched for similar requests in the issue, including closed requests

A detailed description

I hope to add an option to disable the model, because gpt4 is too expensive and does not want to be called by users in some situations.

from openai-forward.

KenyonY avatar KenyonY commented on August 16, 2024

这个选项也许将来会考虑与forward_key结合起来,为不同的forward_key分配不同的权限;但实现日期无法确定 ¯_(ツ)_/¯

如果你希望现在就实现一个简易版本的禁用选项,可以在这里:

valid_payload, payload_info, payload = await self._handle_payload(
request, url_path
)

接在这后面,添加对model名称的判断,大概这样:

if valid_payload:
    if payload_info['model'].startswith("gpt-4"):
         raise HTTPException(
                status_code=status.HTTP_404_NOT_FOUND,
                detail=f"model_not_found",
            )

v0.7.0版本后已实现对不同的key的权限控制。

from openai-forward.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.