GithubHelp home page GithubHelp logo

mochii-neko / infinite-craft-gpt-server Goto Github PK

View Code? Open in Web Editor NEW
7.0 1.0 1.0 8 KB

An alternative server for infinite craft that uses openai api

JavaScript 18.42% Python 81.58%
gpt-4 infinite-craft openai openai-api

infinite-craft-gpt-server's Introduction

Infinity Craft OpenAI server

This is an alternative server that uses OpenAI API instead of infinite craft's internal api.

Installation

  1. Install tampermonkey
  2. Go to https://github.com/YuraSuper2048/infinite-craft-gpt-server/raw/main/interceptor.user.js and install the userscript
  3. Clone the repository (make sure you have git installed in your system)
git clone https://github.com/YuraSuper2048/infinite-craft-gpt-server
cd infinite-craft-gpt-server
  1. Install the requirements
pip install -r requirements.txt
  1. Rename "config.toml.example" to "config.toml"
  2. Edit "config.toml" and put your OpenAI API key
  3. Run the server
uvicorn server:app
  1. Go to Infinite Craft and enjoy your GPT 4 enhanced infinite craft

Notes

GPT 4 is kinda too smart and it will do things that actually make sense, so its much harder to reach things

If you wanna "hard code" some result just put it into SYSTEM_PROMPT in server.py

I think the original used a fine tuned model so i assumed GPT 4 may be not the best at it but it works surprizingly well...

infinite-craft-gpt-server's People

Contributors

uwoneko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

kellarosaa

infinite-craft-gpt-server's Issues

Choices error when combinding things

Logs:

Traceback (most recent call last):
File "C:\Users\Bob\AppData\Local\Programs\Python\Python312\Lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 412, in run_asgi
result = await app( # type: ignore[func-returns-value]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Bob\AppData\Local\Programs\Python\Python312\Lib\site-packages\uvicorn\middleware\proxy_headers.py", line 84, in call
return await self.app(scope, receive, send)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Bob\AppData\Local\Programs\Python\Python312\Lib\site-packages\fastapi\applications.py", line 1054, in call
await super().call(scope, receive, send)
File "C:\Users\Bob\AppData\Local\Programs\Python\Python312\Lib\site-packages\starlette\applications.py", line 123, in call
await self.middleware_stack(scope, receive, send)
File "C:\Users\Bob\AppData\Local\Programs\Python\Python312\Lib\site-packages\starlette\middleware\errors.py", line 186, in call
raise exc
File "C:\Users\Bob\AppData\Local\Programs\Python\Python312\Lib\site-packages\starlette\middleware\errors.py", line 164, in call
await self.app(scope, receive, _send)
File "C:\Users\Bob\AppData\Local\Programs\Python\Python312\Lib\site-packages\starlette\middleware\cors.py", line 91, in call
await self.simple_response(scope, receive, send, request_headers=headers)
File "C:\Users\Bob\AppData\Local\Programs\Python\Python312\Lib\site-packages\starlette\middleware\cors.py", line 146, in simple_response
await self.app(scope, receive, send)
File "C:\Users\Bob\AppData\Local\Programs\Python\Python312\Lib\site-packages\starlette\middleware\exceptions.py", line 62, in call
await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
File "C:\Users\Bob\AppData\Local\Programs\Python\Python312\Lib\site-packages\starlette_exception_handler.py", line 64, in wrapped_app
raise exc
File "C:\Users\Bob\AppData\Local\Programs\Python\Python312\Lib\site-packages\starlette_exception_handler.py", line 53, in wrapped_app
await app(scope, receive, sender)
File "C:\Users\Bob\AppData\Local\Programs\Python\Python312\Lib\site-packages\starlette\routing.py", line 758, in call
await self.middleware_stack(scope, receive, send)
File "C:\Users\Bob\AppData\Local\Programs\Python\Python312\Lib\site-packages\starlette\routing.py", line 778, in app
await route.handle(scope, receive, send)
File "C:\Users\Bob\AppData\Local\Programs\Python\Python312\Lib\site-packages\starlette\routing.py", line 299, in handle
await self.app(scope, receive, send)
File "C:\Users\Bob\AppData\Local\Programs\Python\Python312\Lib\site-packages\starlette\routing.py", line 79, in app
await wrap_app_handling_exceptions(app, request)(scope, receive, send)
File "C:\Users\Bob\AppData\Local\Programs\Python\Python312\Lib\site-packages\starlette_exception_handler.py", line 64, in wrapped_app
raise exc
File "C:\Users\Bob\AppData\Local\Programs\Python\Python312\Lib\site-packages\starlette_exception_handler.py", line 53, in wrapped_app
await app(scope, receive, sender)
File "C:\Users\Bob\AppData\Local\Programs\Python\Python312\Lib\site-packages\starlette\routing.py", line 74, in app
response = await func(request)
^^^^^^^^^^^^^^^^^^^
File "C:\Users\Bob\AppData\Local\Programs\Python\Python312\Lib\site-packages\fastapi\routing.py", line 278, in app
raw_response = await run_endpoint_function(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Bob\AppData\Local\Programs\Python\Python312\Lib\site-packages\fastapi\routing.py", line 191, in run_endpoint_function
return await dependant.call(**values)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Bob\Downloads\Test\server.py", line 54, in pair
completion = await chat_completion(messages)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Bob\Downloads\Test\utils.py", line 34, in chat_completion
return response_json["choices"][0]["message"]["content"]
~~~~~~~~~~~~~^^^^^^^^^^^
KeyError: 'choices'

More indepth instructions for dumb idiots like me

Mostly just the title. I really wanna try this cause it seems really cool but i can't really figure out how to do the uvicorn part. I've cloned the repo to a folder with git but i uvicorn elludes me. python, cmd, and miniconda3 all give a generic "not recognized" command when typing uvicorn. I knows its installed i can see it in my python folders i just don't know to use it :c

Also would this work with local models? Like running my own llm model through Text Generation Webui and using that api link instead of openai's api link. You can edit system prompts, termperature, cfg all dat stuff through Text Gen Webui

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.