{"id":28984361,"url":"https://github.com/exectx/model-rules","last_synced_at":"2025-06-24T17:10:17.528Z","repository":{"id":298654094,"uuid":"931974639","full_name":"exectx/model-rules","owner":"exectx","description":"Rewrite LLM API parameters before sending your request to any OpenAI API compatible provider","archived":false,"fork":false,"pushed_at":"2025-06-20T07:43:18.000Z","size":544,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-20T08:38:22.501Z","etag":null,"topics":["llm","openai-api-compatible","overrides","proxy"],"latest_commit_sha":null,"homepage":"https://rules.exectx.run","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/exectx.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}},"created_at":"2025-02-13T06:47:12.000Z","updated_at":"2025-06-20T07:43:22.000Z","dependencies_parsed_at":"2025-06-12T07:25:52.561Z","dependency_job_id":"2c20553f-03df-475c-b73e-52826fc075e5","html_url":"https://github.com/exectx/model-rules","commit_stats":null,"previous_names":["exectx/model-rules"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/exectx/model-rules","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exectx%2Fmodel-rules","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exectx%2Fmodel-rules/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exectx%2Fmodel-rules/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exectx%2Fmodel-rules/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/exectx","download_url":"https://codeload.github.com/exectx/model-rules/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exectx%2Fmodel-rules/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261721228,"owners_count":23199638,"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":["llm","openai-api-compatible","overrides","proxy"],"created_at":"2025-06-24T17:10:16.890Z","updated_at":"2025-06-24T17:10:17.515Z","avatar_url":"https://github.com/exectx.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rules API Documentation - Rules\n\n## Overview\n\nRules provides a unified API endpoint for interacting with various LLM providers. It allows you to customize request parameters and apply the matching rules before proxying to the configured provider.\n\n## Authentication\n\nAll API requests require authentication using a Bearer token:\n\n```\nAuthorization: Bearer your_api_token\n```\n\nYou can generate API tokens in the dashboard.\n\n## Proxy Endpoint\n\n### Send a Chat Completion Request\n\nUpdate the `baseUrl` parameter in your OpenAI client to point to the proxy endpoint.\n\n**Endpoint**: `POST /api/chat/completions`\n\n**Request Format**:\n\n```json\n{\n  \"model\": \"openai::gpt-4\",\n  \"messages\": [\n    { \"role\": \"system\", \"content\": \"You are a helpful assistant.\" },\n    { \"role\": \"user\", \"content\": \"Tell me about parameter overrides.\" }\n  ],\n  \"temperature\": 0.7,\n  \"max_tokens\": 500\n}\n```\n\n**Model Name Format**:\n\n- With provider prefix: `provider::model` (e.g., `openai::gpt-4`, `anthropic::claude-2`)\n- TODO: Without prefix: Just the model name (e.g., `gpt-4`) - uses default provider\n\n**Response**:\n\nThe response will match the format returned by the OpenAI API.\n\n## Rules\n\nYour request parameters will be combined with any configured provider-level or model-specific rules. Request parameters always take precedence over stored overrides.\n\n## Best Practices\n\n1. Use specific provider prefixes in multi-provider setups\n2. Configure sensible defaults at the provider and model level\n3. Override parameters only when needed for specific requests\n4. Use streaming for real-time responses\n5. Monitor token usage to avoid rate limits\n\n## Error Handling\n\nPossible error responses:\n\n- 400: Bad Request (invalid parameters)\n- 401: Unauthorized (missing or invalid token)\n- 404: Not Found (unknown route or model)\n- 429: Too Many Requests (rate limit exceeded)\n- 500: Internal Server Error\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexectx%2Fmodel-rules","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexectx%2Fmodel-rules","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexectx%2Fmodel-rules/lists"}