Git Product home page Git Product logo

Comments (3)

Yangqing avatar Yangqing commented on September 26, 2024 3

Yep, it's possible.

For the search engine part, check out e.g. the search_with_bing() function, and the photon's init() function. We currently support bing, google and https://serper.dev/. It's probably easy to swap in your own search engine.

For the LLM model, you can replace the openai client to connect to other openai-compatible servers. The related question part requires a bit care, as your llm server need to support function calling / structured output. All lepton LLM endpoints support this (with custom models too) out of the box. With others, you might need a bit of adjustment, and you can also choose to simply turn off related questions.

from search_with_lepton.

Yangqing avatar Yangqing commented on September 26, 2024 1

For local deployment, you just need to do (in commandline):

pip install -U leptonai
lep login

and make sure you log in to your workspace.

For the other non-Lepton hosted models, see above - essentially it is this line

https://github.com/leptonai/search_with_lepton/blob/db27467/search_with_lepton.py#L257

You might want to start with environmental variable RELATED_QUESTIONS=False with other api endpoints.

from search_with_lepton.

georgefeng avatar georgefeng commented on September 26, 2024

I have successfully deployed on lepton.ai, and its lightning-fast response has left a deep impression on me : )

For local deployment, I guess we need to modify the following two parts, right?

thread_local.client = openai.OpenAI(
base_url=f"https://{self.model}.lepton.run/api/v1/",
api_key=os.environ.get("LEPTON_WORKSPACE_TOKEN")
or WorkspaceInfoLocalRecord.get_current_workspace_token(),
# We will set the connect timeout to be 10 seconds, and read/write

"LLM_MODEL": "mixtral-8x7b",

For online deployment, is it not possible to switch to other non-Lepton Hosted models (even those I deployed on Lepton)?"

LLM_MODEL: the LLM model to run. We recommend using mixtral-8x7b, but if you want to experiment other models, you can try the ones hosted on LeptonAI, for example, llama2-70b, llama2-13b, llama2-7b. Note that small models won't work that well.

https://dashboard.lepton.ai/workspace/olcdfyso/explore/detail/search-by-lepton

from search_with_lepton.

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.