Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
9ae46ab
feat: Refactor Anthropic driver
tymondesigns Dec 23, 2025
3b29801
wip
tymondesigns Dec 24, 2025
01b8d38
wip
tymondesigns Dec 29, 2025
2c4d91f
wip
tymondesigns Dec 29, 2025
c674b88
wip
tymondesigns Dec 29, 2025
9882179
fix
tymondesigns Dec 29, 2025
4d9a484
stan
tymondesigns Jan 3, 2026
a610c60
wip
tymondesigns Jan 4, 2026
426b6af
update tests
tymondesigns Jan 4, 2026
7b30834
stan
tymondesigns Jan 4, 2026
44ccc3c
wip
tymondesigns Jan 4, 2026
9713edc
fix and refactor
tymondesigns Jan 4, 2026
6067b83
add caching support
tymondesigns Jan 5, 2026
bfef1bc
wip
tymondesigns Jan 5, 2026
a29b75a
wip
tymondesigns Jan 6, 2026
9705432
wip
tymondesigns Jan 6, 2026
5e01a3a
vercel
tymondesigns Jan 8, 2026
89ccc17
improvements
tymondesigns Jan 9, 2026
50c8000
streaming protocols
tymondesigns Jan 11, 2026
dfe90c3
wip
tymondesigns Jan 12, 2026
224f1c0
pass through thread id
tymondesigns Jan 12, 2026
fc80010
wip
tymondesigns Jan 13, 2026
f56e975
wip
tymondesigns Jan 13, 2026
98bff1f
wip
tymondesigns Jan 14, 2026
949b556
wip
tymondesigns Jan 14, 2026
ceb7a34
wip
tymondesigns Jan 14, 2026
4229d53
wip
tymondesigns Jan 15, 2026
f9f9575
wip
tymondesigns Jan 15, 2026
a6c7836
wip
tymondesigns Jan 16, 2026
6381ba9
:art:
tymondesigns Jan 16, 2026
d086615
stan
tymondesigns Jan 16, 2026
1585093
wip
tymondesigns Jan 19, 2026
fea5c1a
update tests
tymondesigns Jan 20, 2026
2eefc52
update tests
tymondesigns Jan 20, 2026
85b7fc0
fixes
tymondesigns Jan 20, 2026
1689aab
:art:
tymondesigns Jan 20, 2026
e01502b
wip
tymondesigns Jan 21, 2026
0e41a6a
agents as tools
tymondesigns Jan 22, 2026
2a1103f
tweak
tymondesigns Jan 22, 2026
bd8e12a
fix error streaming
tymondesigns Jan 22, 2026
2213024
wip
tymondesigns Jan 23, 2026
0201a9e
use internal package
tymondesigns Jan 25, 2026
0275a18
skills
tymondesigns Jan 26, 2026
a50b1bb
fixes
tymondesigns Jan 27, 2026
de6f4e2
updates
tymondesigns Jan 29, 2026
bddbb8e
fix
tymondesigns Jan 29, 2026
1a474d8
wip
tymondesigns Feb 3, 2026
5286c54
improvements
tymondesigns Feb 5, 2026
d7a06fc
add logger
tymondesigns Feb 7, 2026
dc7de7e
wip
tymondesigns Feb 10, 2026
197c7b9
fixes
tymondesigns Feb 11, 2026
aaffa77
fix constraint
tymondesigns Feb 11, 2026
5550825
cleanup
tymondesigns Feb 22, 2026
8123468
initial docs
tymondesigns Feb 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 0 additions & 1 deletion .cursor/commands/fix-stan.md

This file was deleted.

2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false

[*.yml,*.yaml,*.neon]
[*.yml,*.yaml,*.neon,*.tsx,*.ts]
indent_style = space
indent_size = 2
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
/README.md export-ignore
/testbench.yaml export-ignore
/ecs.php export-ignore
/rector.php export-ignore
/tests export-ignore
/phpstan.neon export-ignore
/workbench export-ignore
/scratchpad.php export-ignore
/phpstan.dist.neon export-ignore
/package.json export-ignore
/vite.config.ts export-ignore
/tsconfig.json export-ignore
/eslint.config.js export-ignore
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ updates:
labels:
- "dependencies"
- "composer"
versioning-strategy: "widen"
versioning-strategy: "increase-if-necessary"
open-pull-requests-limit: 10

- package-ecosystem: "github-actions"
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: Tests

permissions:
contents: read
pull-requests: write

on: [push]

concurrency:
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: Static Analysis

permissions:
contents: read
pull-requests: write

on: [push]

concurrency:
Expand Down Expand Up @@ -65,5 +69,8 @@ jobs:
restore-keys: |
ecs-cache-

- name: Run format checks
run: composer format --no-progress-bar
- name: Run Rector
run: ./vendor/bin/rector process --dry-run --no-progress-bar --no-diffs --output-format=github

- name: Run ECS
run: ./vendor/bin/ecs check --no-progress-bar --no-diffs --output-format=checkstyle
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ composer.lock
.env
.DS_Store
.phpstan-cache
node_modules
public
23 changes: 17 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,31 @@
],
"require": {
"php": "^8.4",
"adhocore/json-fixer": "^1.0",
"cortexphp/json-schema": "dev-main",
"cortexphp/json-repair": "^0.4",
"cortexphp/json-schema": "^1.0",
"cortexphp/model-info": "^0.3",
"illuminate/collections": "^12.0",
"guzzlehttp/psr7": "^2.8",
"illuminate/collections": "^12.49",
"laravel/prompts": "^0.3.8",
"mozex/anthropic-php": "^1.1",
"openai-php/client": "^0.18",
"php-mcp/client": "^1.0",
"psr-discovery/cache-implementations": "^1.2",
"psr-discovery/event-dispatcher-implementations": "^1.1",
"react/async": "^4.3",
"spatie/laravel-package-tools": "^1.17"
"saloonphp/cache-plugin": "^3.0",
"saloonphp/saloon": "^3.14",
"spatie/laravel-package-tools": "^1.17",
"spatie/yaml-front-matter": "^2.1"
},
"require-dev": {
"beyondcode/laravel-dump-server": "^2.1",
"guzzlehttp/guzzle": "^7.9",
"hkulekci/qdrant": "^0.5.8",
"inertiajs/inertia-laravel": "^2.0",
"laravel/wayfinder": "^0.1.13",
"league/event": "^3.0",
"mockery/mockery": "^1.6",
"monolog/monolog": "^3.10",
"orchestra/testbench": "^10.6",
"pestphp/pest": "^4.0",
"pestphp/pest-plugin-type-coverage": "^4.0",
Expand All @@ -60,7 +67,7 @@
}
},
"scripts": {
"test": "pest",
"test": "pest --parallel",
"ecs": "ecs check --fix",
"rector": "rector process",
"stan": "phpstan analyse",
Expand All @@ -86,6 +93,10 @@
"Composer\\Config::disableProcessTimeout",
"@build",
"@php vendor/bin/testbench serve --ansi"
],
"dev": [
"Composer\\Config::disableProcessTimeout",
"npx concurrently 'composer serve' 'npm run dev' -c '#a78bfa,#34d399' --names=server,vite --kill-others"
]
},
"config": {
Expand Down
69 changes: 36 additions & 33 deletions config/cortex.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
declare(strict_types=1);

use Cortex\LLM\Enums\LLMDriver;
use Cortex\LLM\Enums\StreamingProtocol;
use Cortex\Agents\Prebuilt\WeatherAgent;
use Cortex\ModelInfo\Enums\ModelProvider;
use Cortex\ModelInfo\Providers\OllamaModelInfoProvider;
use Cortex\ModelInfo\Providers\LiteLLMModelInfoProvider;
use Cortex\ModelInfo\Providers\LMStudioModelInfoProvider;
Expand All @@ -23,33 +23,23 @@
'llm' => [
'default' => env('CORTEX_DEFAULT_LLM', 'openai'),

'openai' => [
'driver' => LLMDriver::OpenAIChat,
'options' => [
'api_key' => env('OPENAI_API_KEY', ''),
'base_uri' => env('OPENAI_BASE_URI'),
'organization' => env('OPENAI_ORGANIZATION'),
],
'default_model' => 'gpt-4.1-mini',
'default_parameters' => [
'temperature' => null,
'max_tokens' => 1024,
'top_p' => null,
],
'cache' => [
'enabled' => env('CORTEX_LLM_CACHE_ENABLED', false),
'store' => env('CORTEX_LLM_CACHE_STORE'),
'ttl' => env('CORTEX_LLM_CACHE_TTL', 3600),
],

'openai_responses' => [
'openai' => [
'driver' => LLMDriver::OpenAIResponses,
'model_provider' => ModelProvider::OpenAI,
'options' => [
'api_key' => env('OPENAI_API_KEY', ''),
'base_uri' => env('OPENAI_BASE_URI'),
'organization' => env('OPENAI_ORGANIZATION'),
],
'default_model' => 'gpt-5-mini',
'default_model' => 'gpt-4.1-mini',
'default_parameters' => [
'temperature' => null,
'max_tokens' => null,
'max_output_tokens' => 1024,
'top_p' => null,
],
],
Expand All @@ -68,41 +58,42 @@
],
],

'groq' => [
'ollama' => [
'driver' => LLMDriver::OpenAIChat,
// 'driver' => LLMDriver::Anthropic,
'options' => [
'api_key' => env('GROQ_API_KEY', ''),
'base_uri' => env('GROQ_BASE_URI', 'https://api.groq.com/openai/v1'),
'api_key' => 'ollama',
'base_uri' => env('OLLAMA_BASE_URI', 'http://localhost:11434/v1'),
],
'default_model' => 'llama-3.1-8b-instant',
'default_model' => 'gpt-oss:20b',
'default_parameters' => [
'temperature' => null,
'max_tokens' => null,
'max_tokens' => 1024,
'top_p' => null,
],
],

'ollama' => [
'driver' => LLMDriver::OpenAIChat,
'lmstudio' => [
'driver' => LLMDriver::OpenAIResponses,
'options' => [
'api_key' => 'ollama',
'base_uri' => env('OLLAMA_BASE_URI', 'http://localhost:11434/v1'),
'api_key' => 'lmstudio',
'base_uri' => env('LMSTUDIO_BASE_URI', 'http://localhost:1234/v1'),
],
'default_model' => 'gemma3:12b',
'default_model' => 'openai/gpt-oss-20b',
'default_parameters' => [
'temperature' => null,
'max_tokens' => null,
'max_tokens' => 1024,
'top_p' => null,
],
],

'lmstudio' => [
'groq' => [
'driver' => LLMDriver::OpenAIChat,
'options' => [
'api_key' => 'lmstudio',
'base_uri' => env('LMSTUDIO_BASE_URI', 'http://localhost:1234/v1'),
'api_key' => env('GROQ_API_KEY', ''),
'base_uri' => env('GROQ_BASE_URI', 'https://api.groq.com/openai/v1'),
],
'default_model' => 'qwen2.5-14b-instruct-mlx',
'default_model' => 'llama-3.1-8b-instant',
'default_parameters' => [
'temperature' => null,
'max_tokens' => null,
Expand Down Expand Up @@ -365,4 +356,16 @@
'agents' => [
WeatherAgent::class,
],

/*
|--------------------------------------------------------------------------
| Default Streaming Protocol
|--------------------------------------------------------------------------
|
| The default streaming protocol to use for streaming responses.
|
| Supported protocols: "raw", "agui", "vercel", "text"
|
*/
'default_streaming_protocol' => StreamingProtocol::Vercel,
];
13 changes: 13 additions & 0 deletions docs/assets/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/assets/logo-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading