{"id":15288724,"url":"https://github.com/mdbecker/gull_api","last_synced_at":"2026-01-05T14:20:47.792Z","repository":{"id":175008808,"uuid":"653187852","full_name":"mdbecker/gull_api","owner":"mdbecker","description":"GULL-API is a web application backend that can be used to run Large Language Models (LLMs). The interface between the front-end and the back-end is a JSON REST API.","archived":false,"fork":false,"pushed_at":"2023-06-27T12:18:20.000Z","size":41,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-29T11:29:40.587Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mdbecker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-13T15:06:56.000Z","updated_at":"2023-08-31T23:01:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"bb0bbcb6-a9a1-4701-a619-947f74d120f4","html_url":"https://github.com/mdbecker/gull_api","commit_stats":null,"previous_names":["mdbecker/gull_api"],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdbecker%2Fgull_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdbecker%2Fgull_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdbecker%2Fgull_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdbecker%2Fgull_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mdbecker","download_url":"https://codeload.github.com/mdbecker/gull_api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245217791,"owners_count":20579297,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-30T15:52:28.229Z","updated_at":"2026-01-05T14:20:47.755Z","avatar_url":"https://github.com/mdbecker.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GULL-API\n\n![Test](https://github.com/mdbecker/gull_api/actions/workflows/test.yml/badge.svg)\n![Docker Publish](https://github.com/mdbecker/gull_api/actions/workflows/docker-publish.yml/badge.svg?event=release)\n![PyPI Publish](https://github.com/mdbecker/gull_api/actions/workflows/pypi-publish.yml/badge.svg?event=release)\n\n\nGULL-API is a web application backend that can be used to run Large Language Models (LLMs). The interface between the front-end and the back-end is a JSON REST API.\n\n## Features\n\n- Exposes a `/api` route that returns a JSON file describing the parameters of the LLM.\n- Provides a `/llm` route that accepts POST requests with JSON payloads to run the LLM with the specified parameters.\n\n## Installation\n\n### Using Docker\n\n1. Build the Docker image:\n\n   ```\n   docker build -t gull-api .\n   ```\n\n2. Run the Docker container:\n\n   ```\n   docker run -p 8000:8000 gull-api\n   ```\n\nThe API will be available at `http://localhost:8000`.\n\n### Docker Test Mode\n\nTo build and run the Docker container in test mode, use the following commands:\n\n```bash\ndocker build -t gull-api .\ndocker run -v $(pwd)/data:/app/data -v $(pwd)/example_cli.json:/app/cli.json -p 8000:8000 gull-api\n```\n\nIn test mode, an included script echo_args.sh is used instead of a real LLM. This script echoes the arguments it receives, which can be helpful for local testing.\n\n\n### Local Installation\n\n1. Clone the repository:\n\n   ```\n   git clone https://github.com/yourusername/gull-api.git\n   ```\n\n2. Change to the project directory:\n\n   ```\n   cd gull-api\n   ```\n\n3. Install the dependencies:\n\n   ```\n   pip install poetry\n   poetry install\n   ```\n\n4. Configure Environment Variables (Optional):\n\n   `GULL-API` can be configured using environment variables. To do this, create a file named `.env` in the root of the project directory, and set the environment variables there. For example:\n\n   ```\n   DB_URI=sqlite:///mydatabase.db\n   CLI_JSON_PATH=/path/to/cli.json\n   ```\n\n   `GULL-API` uses the `python-dotenv` package to load these environment variables when the application starts.\n\n\n5. Run the application:\n\n   ```\n   uvicorn gull_api.main:app --host 0.0.0.0 --port 8000\n   ```\n\nThe API will be available at `http://localhost:8000`.\n\n## Usage\n\n### `/api` Route\n\nSend a GET request to the `/api` route to retrieve a JSON file describing the parameters of the LLM:\n\n```\nGET http://localhost:8000/api\n```\n\n### `/llm` Route\n\nSend a POST request to the `/llm` route with a JSON payload containing the LLM parameters:\n\n```\nPOST http://localhost:8000/llm\nContent-Type: application/json\n\n{\n  \"Prompt\": \"Once upon a time\",\n  \"Top P\": 0.5\n}\n```\n\n### Example Requests\n\n```bash\ncurl -X POST \"http://localhost:8000/llm\" -H  \"accept: application/json\" -H  \"Content-Type: application/json\" -d \"{\\\"Instruct mode\\\":false, \\\"Maximum length\\\":256, \\\"Prompt\\\":\\\"Hello, world\\\", \\\"Stop sequences\\\":\\\"Goodbye, world\\\", \\\"Temperature\\\":0.7, \\\"Top P\\\":0.95}\"\ncurl -X GET \"http://localhost:8000/api\" -H \"accept: application/json\" | python -mjson.tool\n```\n\n### Example CLI JSON\n\nAn example CLI JSON file is provided in the repository as `example_cli.json`. This file provides an example of the expected structure for defining the command-line arguments for the LLM.\n\n## License\n\nSee LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdbecker%2Fgull_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmdbecker%2Fgull_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdbecker%2Fgull_api/lists"}