{"id":32494158,"url":"https://github.com/nextgengk/nextgenai-powered-by-open-models","last_synced_at":"2026-07-05T19:31:48.821Z","repository":{"id":318013869,"uuid":"1069703152","full_name":"NextGenGk/NextGenAI-Powered-by-Open-Models","owner":"NextGenGk","description":null,"archived":false,"fork":false,"pushed_at":"2025-10-04T14:00:24.000Z","size":154,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-27T12:58:06.318Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://next-gen-ai-powered-by-open-models.vercel.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NextGenGk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-04T13:05:16.000Z","updated_at":"2025-10-04T14:00:27.000Z","dependencies_parsed_at":"2025-10-04T15:14:12.138Z","dependency_job_id":"840073b7-7e35-4794-bdce-0dd62ecdbf05","html_url":"https://github.com/NextGenGk/NextGenAI-Powered-by-Open-Models","commit_stats":null,"previous_names":["nextgengk/nextgenai-powered-by-open-models"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/NextGenGk/NextGenAI-Powered-by-Open-Models","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NextGenGk%2FNextGenAI-Powered-by-Open-Models","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NextGenGk%2FNextGenAI-Powered-by-Open-Models/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NextGenGk%2FNextGenAI-Powered-by-Open-Models/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NextGenGk%2FNextGenAI-Powered-by-Open-Models/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NextGenGk","download_url":"https://codeload.github.com/NextGenGk/NextGenAI-Powered-by-Open-Models/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NextGenGk%2FNextGenAI-Powered-by-Open-Models/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35167259,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-05T02:00:06.290Z","response_time":100,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2025-10-27T12:58:05.156Z","updated_at":"2026-07-05T19:31:48.787Z","avatar_url":"https://github.com/NextGenGk.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NextGenAI - API Management Platform\n\nA Next.js application that provides API key management and authentication layer for your local LLM server, powered by Clerk authentication.\n\n## Features\n\n- 🔐 **Clerk Authentication v5** - Latest secure user management with social logins\n- 🔑 **API Key Management** - Generate and manage multiple API keys per user\n- 📊 **Rate Limiting** - Configurable rate limits per API key\n- 📈 **Usage Analytics** - Track requests, tokens, and response times\n- 🛡️ **Secure Proxy** - Protected gateway to your LLM server\n- 💻 **Modern Dashboard** - Clean, responsive interface\n- 🗄️ **PostgreSQL** - Robust database with Prisma ORM\n- ⚡ **Next.js 14.2** - Latest Next.js with App Router\n\n## Architecture\n\n```\nUser Request → NextGenAI (API Gateway) → Local LLM Server\n     ↓\nClerk Auth → API Key Validation → Rate Limiting → Request Logging\n```\n\n## Quick Start\n\n### 1. Setup\n\n```bash\n# Run the setup script\nnode setup.js\n\n# Or manually:\nnpm install --legacy-peer-deps\nnpx prisma generate\nnpx prisma db push\n```\n\n### 2. Clerk Configuration\n\n1. Create a [Clerk account](https://clerk.com)\n2. Create a new Clerk application\n3. Get your API keys from the Clerk dashboard\n\n### 3. Environment Configuration\n\nUpdate your `.env` file:\n\n```env\nDATABASE_URL=\"your-postgresql-connection-string\"\nNEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=\"pk_test_...\"\nCLERK_SECRET_KEY=\"sk_test_...\"\nNEXT_PUBLIC_CLERK_SIGN_IN_URL=\"/sign-in\"\nNEXT_PUBLIC_CLERK_SIGN_UP_URL=\"/sign-up\"\nNEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=\"/dashboard\"\nNEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=\"/dashboard\"\nLLM_BASE_URL=\"http://localhost:12434/engines/llama.cpp/v1\"\nLLM_MODEL=\"ai/gpt-oss\"\n```\n\n### 4. Start the Application\n\n```bash\nnpm run dev\n```\n\nVisit `http://localhost:3000` to access the application.\n\n## Usage\n\n### 1. Authentication\n- Click \"Sign Up\" to create a new account\n- Sign in with email/password or social providers (configured in Clerk)\n- Clerk handles all authentication flows securely\n\n### 2. Generate API Keys\n- Access the dashboard at `/dashboard`\n- Click \"Create New API Key\"\n- Set a name and rate limit\n- Copy your API key\n\n### 3. Use the API\n\n```bash\ncurl -X POST http://localhost:3000/api/v1/chat/completions \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"ai/gpt-oss\",\n    \"messages\": [\n      {\n        \"role\": \"user\", \n        \"content\": \"Hello, how are you?\"\n      }\n    ]\n  }'\n```\n\n### 4. JavaScript/Python Example\n\n```javascript\n// JavaScript\nconst response = await fetch('http://localhost:3000/api/v1/chat/completions', {\n  method: 'POST',\n  headers: {\n    'Authorization': 'Bearer YOUR_API_KEY',\n    'Content-Type': 'application/json'\n  },\n  body: JSON.stringify({\n    model: 'ai/gpt-oss',\n    messages: [{ role: 'user', content: 'Hello!' }]\n  })\n});\n\nconst data = await response.json();\nconsole.log(data.choices[0].message.content);\n```\n\n```python\n# Python\nimport requests\n\nresponse = requests.post(\n    'http://localhost:3000/api/v1/chat/completions',\n    headers={\n        'Authorization': 'Bearer YOUR_API_KEY',\n        'Content-Type': 'application/json'\n    },\n    json={\n        'model': 'ai/gpt-oss',\n        'messages': [{'role': 'user', 'content': 'Hello!'}]\n    }\n)\n\nprint(response.json()['choices'][0]['message']['content'])\n```\n\n## API Endpoints\n\n### Authentication\n- Handled by Clerk (sign-in, sign-up, user management)\n- Protected routes automatically secured by middleware\n\n### API Key Management\n- `GET /api/keys` - List user's API keys\n- `POST /api/keys` - Create new API key\n\n### LLM Proxy\n- `POST /api/v1/chat/completions` - Chat completions (OpenAI compatible)\n\n## Database Schema\n\nThe application uses SQLite with Prisma ORM:\n\n- **Users**: Store user accounts\n- **ApiKeys**: Store API keys with rate limits\n- **Requests**: Log all API requests for analytics\n\n## Security Features\n\n- 🔐 **Clerk Authentication** - Enterprise-grade security with MFA support\n- 🎫 **Session Management** - Secure session handling by Clerk\n- 🚦 **Rate Limiting** - Per API key request limits\n- 📝 **Request Logging** - Complete audit trail\n- 🛡️ **API Key Validation** - Secure key-based access control\n- 🔒 **Route Protection** - Middleware-based route security\n\n## Development\n\n### Database Management\n\n```bash\n# View database\nnpx prisma studio\n\n# Reset database\nnpx prisma db push --force-reset\n\n# Generate new migration\nnpx prisma migrate dev\n```\n\n### Project Structure\n\n```\n├── app/\n│   ├── api/           # API routes\n│   ├── dashboard/     # Dashboard page\n│   ├── login/         # Login page\n│   └── register/      # Register page\n├── lib/\n│   ├── auth.ts        # Authentication utilities\n│   ├── prisma.ts      # Database client\n│   └── openai-client.ts # LLM client\n├── prisma/\n│   └── schema.prisma  # Database schema\n└── README.md\n```\n\n## Deployment\n\nFor production deployment:\n\n1. Use a proper database (PostgreSQL/MySQL)\n2. Set strong secrets in environment variables\n3. Enable HTTPS\n4. Configure proper CORS settings\n5. Set up monitoring and logging\n\n## Troubleshooting\n\n### Common Issues\n\n1. **Database connection errors**: Run `npx prisma db push`\n2. **LLM server not responding**: Check if your local LLM is running on the correct port\n3. **Authentication issues**: Verify JWT_SECRET is set in .env\n\n### Support\n\nCheck the logs in your terminal for detailed error messages. Most issues are related to:\n- Missing environment variables\n- Database not initialized\n- LLM server not running","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnextgengk%2Fnextgenai-powered-by-open-models","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnextgengk%2Fnextgenai-powered-by-open-models","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnextgengk%2Fnextgenai-powered-by-open-models/lists"}