ading2210 / vercel-llm-api

A reverse engineered Python API wrapper for the Vercel AI Playground, which provides free access to many large language models without needing an account.
https://pypi.org/project/vercel-llm-api
GNU General Public License v3.0
153 stars 13 forks source link

Cannot get model ids anymore #18

Closed Ivang71 closed 11 months ago

Ivang71 commented 11 months ago

Looks like Vercel introduced breaking changes that prevent the script from parsing the model ids.

$ python3 examples/generate.py 
INFO:root:Downloading homepage...
INFO:root:Downloading and parsing scripts...
Traceback (most recent call last):
  File "/home/lao/projects-wsl/vercel-llm-api/examples/generate.py", line 8, in <module>
    client = vercel_ai.Client()
  File "/home/lao/.local/lib/python3.10/site-packages/vercel_ai.py", line 43, in __init__
    self.model_ids = list(self.models.keys())
AttributeError: 'list' object has no attribute 'keys'
ading2210 commented 11 months ago

I cannot reproduce this bug. Downloading the model list works fine for me.

(.venv) allen@greencloud-instance-1:~/projects/vercel-llm-api$ python3 examples/generate.py 
INFO:root:Downloading homepage...
INFO:root:Downloading and parsing scripts...
INFO:root:Sending to openai:gpt-3.5-turbo: Summarize the GNU GPL v3 in 3 paragraphs. 850
INFO:root:Fetching token from https://sdk.vercel.ai/openai.jpeg
INFO:root:Waiting for response
The GNU General Public License version 3 (GNU GPL v3) is a widely used free software license that was published in 2007. It grants users the freedom to use, modify, and distribute software covered by this license. The main goal of the GNU GPL v3 is to protect these freedoms for all users by ensuring that any modifications or improvements made to the software must be shared with others.

Firstly, the GNU GPL v3 emphasizes user freedom and strives to prevent any restrictions on how people can use, copy, or share software. It guarantees that anyone who receives a copy of the licensed program also receives access to its source code. This enables users to study how it works and modify it if needed.

Secondly, the license includes provisions aimed at protecting against digital rights management (DRM) systems that could restrict user freedom. It prohibits distribution of modified versions of licensed programs if they are designed specifically for DRM enforcement purposes, as this would limit users' ability to exercise their rights under the license.

Finally, another crucial aspect of the GNU GPL v3 is its compatibility with other licenses. The FSF ensures compatibility between different versions of their licenses so developers have flexibility when choosing which one suits their needs best. However, there may be some limitations when combining code from
Ivang71 commented 11 months ago

After some testing I think it's the problem with my ip being banned by Vercel or something, but it also does not work under proxy though.

Anyway, looks like it's not the problem with the code.