{"id":47936608,"url":"https://github.com/tangle-network/openrouter-blueprint-template","last_synced_at":"2026-04-04T07:44:29.521Z","repository":{"id":292938647,"uuid":"979057650","full_name":"tangle-network/openrouter-blueprint-template","owner":"tangle-network","description":"A template for creating a Tangle Blueprint for providing a local LLM through Openrouter","archived":false,"fork":false,"pushed_at":"2025-10-14T23:28:49.000Z","size":721,"stargazers_count":1,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-04T07:44:28.460Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tangle-network.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","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-05-06T23:50:10.000Z","updated_at":"2026-02-28T05:05:57.000Z","dependencies_parsed_at":"2025-05-12T23:30:10.336Z","dependency_job_id":"a6b775b1-6563-40d1-9181-af04a546982e","html_url":"https://github.com/tangle-network/openrouter-blueprint-template","commit_stats":null,"previous_names":["tangle-network/openrouter-blueprint-template"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tangle-network/openrouter-blueprint-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tangle-network%2Fopenrouter-blueprint-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tangle-network%2Fopenrouter-blueprint-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tangle-network%2Fopenrouter-blueprint-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tangle-network%2Fopenrouter-blueprint-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tangle-network","download_url":"https://codeload.github.com/tangle-network/openrouter-blueprint-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tangle-network%2Fopenrouter-blueprint-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31392186,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T04:26:24.776Z","status":"ssl_error","status_checked_at":"2026-04-04T04:23:34.147Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":"2026-04-04T07:44:28.861Z","updated_at":"2026-04-04T07:44:29.490Z","avatar_url":"https://github.com/tangle-network.png","language":"Rust","readme":"# OpenRouter Blueprint Template\n\nA Tangle Blueprint template for creating OpenRouter providers that can balance requests across locally hosted LLMs.\n\n## Overview\n\nThis template provides a framework for creating LLM providers on OpenRouter that can balance requests across locally hosted LLMs. It is designed to be completely general and not tied to any specific LLM implementation, allowing you to create blueprints for any local LLM.\n\nThe template includes:\n\n- Generic interfaces for interacting with LLMs\n- Load balancing across multiple LLM nodes\n- Streaming support for efficient handling of large responses\n- Metrics collection for informed load balancing decisions\n\n## Architecture\n\nThe OpenRouter Blueprint template follows a modular architecture:\n\n- **LLM Interface**: Defines standard interfaces and data models for interacting with LLMs\n- **Load Balancer**: Distributes requests across multiple LLM nodes based on various strategies\n- **Context**: Manages shared state and provides access to LLM clients\n- **Job Handlers**: Process requests from Tangle and return responses\n\n## Documentation\n\n- [Configuration Guide](CONFIGURATION.md): Detailed guide on configuring the OpenRouter Blueprint\n- [Deployment Guide](DEPLOYMENT.md): Instructions for deploying the OpenRouter Blueprint\n\n## Features\n\n- **Generic LLM Interface**: Standardized interface for any LLM implementation\n- **Load Balancing**: Built-in support for distributing requests across multiple LLM nodes\n- **Streaming Support**: Framework for handling streaming responses from LLMs\n- **Metrics Collection**: Standard metrics tracking for load balancing decisions\n- **Configuration Management**: Flexible configuration via files and environment variables\n- **Comprehensive Testing**: Robust test suite for ensuring reliability\n- **Security Features**: Authentication and rate limiting for API endpoints\n\n## Getting Started\n\n### Prerequisites\n\n- Rust toolchain (1.70+)\n- Tangle node (for deployment)\n\n### Installation\n\n1. Clone this repository:\n\n```bash\ngit clone https://github.com/your-username/open-router-blueprint-template.git\ncd open-router-blueprint-template\n```\n\n2. Build the project:\n\n```bash\ncargo build --release\n```\n\n3. Create a configuration file:\n\n```bash\ncp config.sample.json config.json\n```\n\n4. Edit the configuration file to match your environment.\n\n5. Run the blueprint:\n\n```bash\n./target/release/open-router-blueprint-template-bin --config config.json\n```\n\nFor more detailed configuration options, see the [Configuration Guide](CONFIGURATION.md).\n\n## Extending the Template\n\nThis template is designed to be extended for specific LLM implementations. Here's how to create a blueprint for your specific LLM:\n\n1. **Create a new blueprint** based on this template\n2. **Implement the LLM client** by implementing the `LlmClient` trait for your specific LLM\n3. **Add streaming support** by implementing the `StreamingLlmClient` trait (optional)\n4. **Update the context** to initialize your LLM client\n5. **Configure the load balancer** to use your preferred strategy\n\n### Example: Implementing a Custom LLM Client\n\n```rust\nuse async_trait::async_trait;\nuse open_router_blueprint_template_lib::llm::{LlmClient, Result, ChatCompletionRequest, ChatCompletionResponse, /* ... */};\n\npub struct MyCustomLlmClient {\n    // Your client-specific fields\n}\n\n#[async_trait]\nimpl LlmClient for MyCustomLlmClient {\n    fn get_supported_models(\u0026self) -\u003e Vec\u003cModelInfo\u003e {\n        // Return the models supported by your LLM\n    }\n\n    fn get_capabilities(\u0026self) -\u003e LlmCapabilities {\n        // Return the capabilities of your LLM\n    }\n\n    fn get_metrics(\u0026self) -\u003e NodeMetrics {\n        // Return metrics for your LLM\n    }\n\n    async fn chat_completion(\u0026self, request: ChatCompletionRequest) -\u003e Result\u003cChatCompletionResponse\u003e {\n        // Implement chat completion for your LLM\n    }\n\n    // Implement other required methods...\n}\n\n## Load Balancing Strategies\n\nThe template supports several load balancing strategies:\n\n- **RoundRobin**: Distributes requests evenly across all nodes\n- **LeastLoaded**: Routes requests to the node with the fewest active requests\n- **CapabilityBased**: Selects nodes based on their capabilities for specific models\n- **LatencyBased**: Routes requests to the node with the lowest response time\n\n## Testing\n\nThe OpenRouter Blueprint includes a comprehensive test suite to ensure reliability and correctness:\n\n```bash\n# Run all tests\ncargo test\n\n# Run specific tests\ncargo test config_tests\ncargo test load_balancer_tests\ncargo test llm_tests\n```\n\nThe test suite includes:\n\n- **Unit Tests**: Tests for individual components\n- **Integration Tests**: Tests for component interactions\n- **Mock Implementations**: Mock LLM clients for testing without external dependencies\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftangle-network%2Fopenrouter-blueprint-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftangle-network%2Fopenrouter-blueprint-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftangle-network%2Fopenrouter-blueprint-template/lists"}