Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nano GPT API Support #326

Open
sussyboiiii opened this issue Feb 24, 2025 · 7 comments
Open

Nano GPT API Support #326

sussyboiiii opened this issue Feb 24, 2025 · 7 comments

Comments

@sussyboiiii
Copy link

nano-gpt.com also offers an API and they accept crypto payments. Support for their api would be really useful.

Thanks!

@frdel
Copy link
Owner

frdel commented Feb 24, 2025

You should be able to use it already as it is an openai compatible endpoint.
You can select Other as model provider and fill some additional arguments in the box below like
base_url=https://nano-gpt.com/api/v1/chat/completions
or maybe some others.

@sussyboiiii
Copy link
Author

Ah ok good to know,

I got the urls and api key from nano gpt, but where exactly do I enter the api key, url etc.?

@sussyboiiii
Copy link
Author

adding base_url and api_key I get error code: 405

@sussyboiiii
Copy link
Author

This was the solution for the box below

base_url=https://nano-gpt.com/api/v1
api_key=YOUR_API_KEY

@frdel
Copy link
Owner

frdel commented Feb 24, 2025

Great job!

@sussyboiiii
Copy link
Author

sussyboiiii commented Feb 24, 2025

Well it worked and now it stopped working somehow.

After the 405 error it says Initializing VectorDB in '/default'

Also when using the nano gpt example pyhton script it works still with the same model.

the error:

Traceback (most recent call last):
Traceback (most recent call last):
  File "/a0/agent.py", line 265, in monologue
    prompt = await self.prepare_prompt(loop_data=self.loop_data)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/a0/agent.py", line 349, in prepare_prompt
    await self.call_extensions("message_loop_prompts", loop_data=loop_data)
  File "/a0/agent.py", line 679, in call_extensions
    await cls(agent=self).execute(**kwargs)
  File "/a0/python/extensions/message_loop_prompts/_91_recall_wait.py", line 13, in execute
    await task
  File "/a0/python/extensions/message_loop_prompts/_50_recall_memories.py", line 67, in search_memories
    db = await Memory.get(self.agent)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

>>>  5 stack lines skipped <<<

  File "/opt/venv/lib/python3.11/site-packages/langchain_openai/embeddings/base.py", line 588, in embed_documents
    return self._get_len_safe_embeddings(texts, engine=engine)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.11/site-packages/langchain_openai/embeddings/base.py", line 483, in _get_len_safe_embeddings
    response = self.client.create(
               ^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.11/site-packages/openai/resources/embeddings.py", line 128, in create
    return self._post(
           ^^^^^^^^^^^
  File "/opt/venv/lib/python3.11/site-packages/openai/_base_client.py", line 1290, in post
    return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.11/site-packages/openai/_base_client.py", line 967, in request
    return self._request(
           ^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.11/site-packages/openai/_base_client.py", line 1071, in _request
    raise self._make_status_error_from_response(err.response) from None
openai.APIStatusError: Error code: 405

@sussyboiiii sussyboiiii reopened this Feb 24, 2025
@sussyboiiii
Copy link
Author

this happens once I press the restart button. The way to fix it is to remove the config use ollama and then repopulate the config with the nano gpt backend, key and model

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants