Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ api_keys:
auth_token: "your-huggingface-token-for-authorized-models"
cache_dir: "your-cache-dir-for-saving-models"
novita: "your-novita-api-key"
orcarouter: "your-orcarouter-api-key"
```

To obtain these API keys:
Expand All @@ -234,6 +235,7 @@ To obtain these API keys:
5. HuggingFace Token: Visit https://huggingface.co/settings/tokens
6. Anthropic API: Visit https://console.anthropic.com/keys
7. Novita AI API: Visit https://novita.ai/api-keys
8. OrcaRouter API: Visit https://www.orcarouter.ai

#### Configure LLM Models
You can configure which LLM models to use in the same `aios/config/config.yaml` file. Here's an example configuration:
Expand All @@ -250,6 +252,10 @@ llms:
- name: "meta-llama/Llama-3.1-8B-Instruct"
backend: "vllm"
hostname: "http://localhost:8091/v1" # Make sure to run vllm server

# OrcaRouter Models
- name: "orcarouter/auto"
backend: "orcarouter" # Routes via https://api.orcarouter.ai/v1
```

**Using Ollama Models:**
Expand Down Expand Up @@ -286,6 +292,16 @@ You can configure HuggingFace models with specific GPU memory allocation:
eval_device: "cuda:0" # Device for model evaluation
```

**Using OrcaRouter Models:**
[OrcaRouter](https://www.orcarouter.ai) is an OpenAI-compatible gateway that exposes 160+ models (OpenAI, Anthropic, DeepSeek, Qwen, and more) behind a single API key. Add the `orcarouter` backend to use it:

```yaml
- name: "orcarouter/auto"
backend: "orcarouter"
```

The gateway endpoint defaults to `https://api.orcarouter.ai/v1` (override with `hostname`). Set your key via `ORCAROUTER_API_KEY` or the `orcarouter` entry under `api_keys` in `aios/config/config.yaml`.

#### Set up interactively

Alternatively, you can set up aios configurations interactively by using the following command.
Expand All @@ -305,6 +321,7 @@ When no environment variables are set, the following API keys will be shown:
- `HF_AUTH_TOKEN`: HuggingFace authentication token for accessing models
- `HF_HOME`: Optional path to store HuggingFace models
- `NOVITA_API_KEY`: Novita AI API key for accessing Novita AI services
- `ORCAROUTER_API_KEY`: OrcaRouter API key for accessing OrcaRouter gateway models

#### Launch AIOS
After you setup your keys or environment parameters, then you can follow the instructions below to start.
Expand Down Expand Up @@ -378,6 +395,7 @@ Make sure you have installed a virtualized environment with GUI, then you can re
| ollama | [All Models](https://ollama.com/search) | ✅ | model-name | ollama | - |
| vLLM | [All Models](https://docs.vllm.ai/en/latest/) | ✅ | model-name | vllm | - |
| Novita | [All Models](https://novita.ai/models/llm) | ✅ | model-name | novita | NOVITA_API_KEY |
| [OrcaRouter](https://www.orcarouter.ai) | [All Models](https://www.orcarouter.ai) | ✅ | model-name | orcarouter | ORCAROUTER_API_KEY |

## 🔧 Experimental Rust Rewrite (aios-rs)
An early experimental Rust scaffold lives in `aios-rs/` providing trait definitions and minimal placeholder implementations (context, memory, storage, tool, scheduler, llm). This is NOT feature-parity yet; it's a foundation for incremental porting and performance-focused components.
Expand Down
7 changes: 7 additions & 0 deletions aios/config/config.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ api_keys:
huggingface:
auth_token: "" # Your HuggingFace auth token for authorized models
cache_dir: "" # Your cache directory for saving huggingface models
orcarouter: "" # OrcaRouter API key

# LLM Configuration
llms:
Expand Down Expand Up @@ -54,6 +55,12 @@ llms:
# backend: "vllm"
# hostname: "http://localhost:8091"

# OrcaRouter Models
# OrcaRouter (https://www.orcarouter.ai) is an OpenAI-compatible gateway that
# routes to 160+ models (OpenAI, Anthropic, DeepSeek, Qwen, ...) from one API key.
# - name: "orcarouter/auto"
# backend: "orcarouter"

router:
strategy: "sequential"
bootstrap_url: "https://drive.google.com/file/d/1SF7MAvtnsED7KMeMdW3JDIWYNGPwIwL7/view"
Expand Down
3 changes: 2 additions & 1 deletion aios/config/config_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ def get_api_key(self, provider: str) -> Optional[str]:
"gemini": "GEMINI_API_KEY",
"groq": "GROQ_API_KEY",
"anthropic": "ANTHROPIC_API_KEY",
"huggingface": "HF_AUTH_TOKEN"
"huggingface": "HF_AUTH_TOKEN",
"orcarouter": "ORCAROUTER_API_KEY"
}
if provider in env_var_map:
env_var = env_var_map[provider]
Expand Down
17 changes: 16 additions & 1 deletion aios/llm_core/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ def _setup_api_keys(self) -> None:
"anthropic": "ANTHROPIC_API_KEY",
"huggingface": "HF_AUTH_TOKEN",
"novita": "NOVITA_API_KEY",
"orcarouter": "ORCAROUTER_API_KEY",
}

logger.info("=== LLMAdapter Initialization ===")
Expand Down Expand Up @@ -250,7 +251,21 @@ def _initialize_single_llm(self, config: LLMConfig) -> Optional[Union[str, HfLoc
base_url=config.hostname,
api_key=config.api_key or "sk-placeholder" # Use provided key or a placeholder
)


case "orcarouter":
# OrcaRouter is an OpenAI-compatible gateway (https://api.orcarouter.ai/v1)
# that routes to 160+ models from a single API key.
base_url = config.hostname or "https://api.orcarouter.ai/v1"
api_key = (
config.api_key
or os.getenv("ORCAROUTER_API_KEY")
or "sk-placeholder"
)
return OpenAI(
base_url=base_url,
api_key=api_key,
)

case _:
# Handle LiteLLM supported backends
backend_name = config.backend
Expand Down
1 change: 1 addition & 0 deletions aios/utils/commands/launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ def show_available_api_keys():
print("- GROQ_API_KEY (Groq API key)")
print("- HF_AUTH_TOKEN (HuggingFace authentication token)")
print("- HF_HOME (Optional: Path to store HuggingFace models)")
print("- ORCAROUTER_API_KEY (OrcaRouter API key)")

def handle_env_command(args):
env_file = os.path.expanduser("~/.aios-1/.env")
Expand Down