GithubHelp home page GithubHelp logo

kagisearch / pyllms Goto Github PK

View Code? Open in Web Editor NEW
675.0 675.0 43.0 602 KB

Minimal Python library to connect to LLMs (OpenAI, Anthropic, AI21, Cohere, Aleph Alpha, HuggingfaceHub, Google PaLM2, with a built-in model performance benchmark.

Home Page: https://kagi.com

License: MIT License

Python 100.00%

pyllms's People

Contributors

bkiat1123 avatar denisolt-relyanceai avatar eyalpazz avatar laksh-bhat avatar liamniisan avatar soldni avatar vprelovac avatar wakamex avatar willmeyers avatar z64 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pyllms's Issues

Heavy dependencies

Hey,
I have noticed that there is a heavy dependency accelerate included in the requirements.
accelerate has a dependency on torch, which results in a pretty big total size (I believe torch is about 600mb). I traced down the dependency to a PR that was adding support for local LLM runs.

Have you considered adding extras_require to setup.py so these local run dependencies are only installed if the user wants to run the LLM locally?

I am happy to open up a PR with a suggestion.

HuggingFace max_tokens

HuggingFace max_tokens parameter name in complete function is "max _tokens" instead of "max_length"

Exception when calling aleph alpha model?

Hi all,

I´m getting the following exception when initializing the aleph alpha model:

Found luminous-extended in AlephAlphaProvider
127.0.0.1 - - [11/Sep/2023 21:20:51] "POST /init HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/home/cw/LLM_BACKEND/LLMB_backend.py", line 164, in init
    pyllmsModel=llms.init(alephalpha_api_key=aleph_alpha_key, model=model)
  File "/home/cw/.local/lib/python3.10/site-packages/llms/__init__.py", line 8, in init
    return LLMS(*args, **kwargs)
  File "/home/cw/.local/lib/python3.10/site-packages/llms/llms.py", line 70, in __init__
    self._providers.append(provider.provider(api_key=provider.api_key, model=single_model))
  File "/home/cw/.local/lib/python3.10/site-packages/llms/providers/aleph.py", line 28, in __init__
    self.async_client = AsyncClient(api_key)
  File "/home/cw/.local/lib/python3.10/site-packages/aleph_alpha_client/aleph_alpha_client.py", line 618, in __init__
    self.session = RetryClient(
  File "/home/cw/.local/lib/python3.10/site-packages/aiohttp_retry/client.py", line 193, in __init__
    client = ClientSession(*args, **kwargs)
  File "/home/cw/.local/lib/python3.10/site-packages/aiohttp/client.py", line 228, in __init__
    loop = get_running_loop(loop)
  File "/home/cw/.local/lib/python3.10/site-packages/aiohttp/helpers.py", line 288, in get_running_loop
    loop = asyncio.get_event_loop()
  File "/usr/lib/python3.10/asyncio/events.py", line 656, in get_event_loop
    raise RuntimeError('There is no current event loop in thread %r.'
RuntimeError: There is no current event loop in thread 'Thread-20 (process_request_thread)'.

is that issue known?
I don´t face this problem mit openai models, like gpt-3.5-turbo
Thanks!

Embeddings support?

Hi,

I am wandering if the following feature is considered to be added in this project, and/or if potential PR in that direction might be welcomed ?

  • Adding the support for embedding creation with the various models when they support it (and perhaps evaluation too)

Bug in count tokens in google

In Google you are calculating the tokens by the length of the prompt and completion but it should be done with google count_message_tokens function/endpoint

benchmark is failing

I've tried bechmark with default problems and a custom problem. In both cases its giving an error - KeyError: 0
From the logs, it is generating response for all the problems using all the LLMs models in the list, and then failing.

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.