aicf-core 0.5.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- aicf_core-0.5.0/LICENSE +201 -0
- aicf_core-0.5.0/PKG-INFO +351 -0
- aicf_core-0.5.0/README.md +306 -0
- aicf_core-0.5.0/aicf_core.egg-info/PKG-INFO +351 -0
- aicf_core-0.5.0/aicf_core.egg-info/SOURCES.txt +302 -0
- aicf_core-0.5.0/aicf_core.egg-info/dependency_links.txt +1 -0
- aicf_core-0.5.0/aicf_core.egg-info/requires.txt +23 -0
- aicf_core-0.5.0/aicf_core.egg-info/top_level.txt +2 -0
- aicf_core-0.5.0/harness/__init__.py +114 -0
- aicf_core-0.5.0/harness/agent/__init__.py +57 -0
- aicf_core-0.5.0/harness/agent/adapters.py +256 -0
- aicf_core-0.5.0/harness/agent/assembler.py +271 -0
- aicf_core-0.5.0/harness/agent/collab.py +443 -0
- aicf_core-0.5.0/harness/agent/context.py +165 -0
- aicf_core-0.5.0/harness/agent/engine.py +862 -0
- aicf_core-0.5.0/harness/agent/engine_config.py +70 -0
- aicf_core-0.5.0/harness/agent/events.py +90 -0
- aicf_core-0.5.0/harness/agent/loop.py +811 -0
- aicf_core-0.5.0/harness/agent/modes.py +75 -0
- aicf_core-0.5.0/harness/agent/subagent.py +144 -0
- aicf_core-0.5.0/harness/agent/swarm.py +237 -0
- aicf_core-0.5.0/harness/agent_runtime.py +161 -0
- aicf_core-0.5.0/harness/codegraph/__init__.py +30 -0
- aicf_core-0.5.0/harness/codegraph/builder.py +146 -0
- aicf_core-0.5.0/harness/codegraph/imports.py +115 -0
- aicf_core-0.5.0/harness/codegraph/search.py +68 -0
- aicf_core-0.5.0/harness/codegraph/symbol.py +104 -0
- aicf_core-0.5.0/harness/codegraph/watcher.py +91 -0
- aicf_core-0.5.0/harness/context_assembly.py +306 -0
- aicf_core-0.5.0/harness/context_gatherer.py +216 -0
- aicf_core-0.5.0/harness/conversation.py +600 -0
- aicf_core-0.5.0/harness/decisions/__init__.py +85 -0
- aicf_core-0.5.0/harness/decisions/core.py +371 -0
- aicf_core-0.5.0/harness/decisions/service.py +140 -0
- aicf_core-0.5.0/harness/decisions/use_cases.py +443 -0
- aicf_core-0.5.0/harness/filediff.py +202 -0
- aicf_core-0.5.0/harness/groupchat.py +176 -0
- aicf_core-0.5.0/harness/images.py +330 -0
- aicf_core-0.5.0/harness/learning/__init__.py +63 -0
- aicf_core-0.5.0/harness/learning/dataset_builder.py +190 -0
- aicf_core-0.5.0/harness/learning/evaluator.py +252 -0
- aicf_core-0.5.0/harness/learning/probes.py +321 -0
- aicf_core-0.5.0/harness/learning/promotion.py +151 -0
- aicf_core-0.5.0/harness/learning/selfplay.py +590 -0
- aicf_core-0.5.0/harness/learning/teacher.py +306 -0
- aicf_core-0.5.0/harness/memory/__init__.py +17 -0
- aicf_core-0.5.0/harness/memory/base.py +71 -0
- aicf_core-0.5.0/harness/memory/in_memory.py +51 -0
- aicf_core-0.5.0/harness/memory/vector.py +19 -0
- aicf_core-0.5.0/harness/personality/__init__.py +771 -0
- aicf_core-0.5.0/harness/personality/audit.py +136 -0
- aicf_core-0.5.0/harness/personality/character_card.py +301 -0
- aicf_core-0.5.0/harness/personality/distillation_engine.py +481 -0
- aicf_core-0.5.0/harness/personality/dynamic_synthesizer.py +179 -0
- aicf_core-0.5.0/harness/personality/dynamics_engine.py +143 -0
- aicf_core-0.5.0/harness/personality/events.py +201 -0
- aicf_core-0.5.0/harness/personality/evidence_accumulator.py +324 -0
- aicf_core-0.5.0/harness/personality/experience_importer.py +141 -0
- aicf_core-0.5.0/harness/personality/persistence.py +228 -0
- aicf_core-0.5.0/harness/personality/personality_generator.py +324 -0
- aicf_core-0.5.0/harness/personality/personality_judge.py +245 -0
- aicf_core-0.5.0/harness/personality/state_manager.py +306 -0
- aicf_core-0.5.0/harness/personality/traits.py +245 -0
- aicf_core-0.5.0/harness/pipeline/__init__.py +28 -0
- aicf_core-0.5.0/harness/pipeline/base.py +165 -0
- aicf_core-0.5.0/harness/pipeline/events.py +98 -0
- aicf_core-0.5.0/harness/pipeline/filters.py +41 -0
- aicf_core-0.5.0/harness/pipeline/manager.py +152 -0
- aicf_core-0.5.0/harness/pipeline/outputs.py +65 -0
- aicf_core-0.5.0/harness/pipeline/pipeline.py +94 -0
- aicf_core-0.5.0/harness/prompts/__init__.py +5 -0
- aicf_core-0.5.0/harness/prompts/engine.py +195 -0
- aicf_core-0.5.0/harness/sdk.py +298 -0
- aicf_core-0.5.0/harness/skills/__init__.py +61 -0
- aicf_core-0.5.0/harness/skills/agent_bridge.py +81 -0
- aicf_core-0.5.0/harness/skills/base.py +54 -0
- aicf_core-0.5.0/harness/skills/capabilities.py +120 -0
- aicf_core-0.5.0/harness/skills/env_loader.py +98 -0
- aicf_core-0.5.0/harness/skills/loader.py +88 -0
- aicf_core-0.5.0/harness/skills/registry.py +468 -0
- aicf_core-0.5.0/harness/skills/validator.py +296 -0
- aicf_core-0.5.0/harness/skills/yaml_loader.py +234 -0
- aicf_core-0.5.0/harness/skills/yaml_manager.py +296 -0
- aicf_core-0.5.0/harness/tools/__init__.py +25 -0
- aicf_core-0.5.0/harness/tools/base.py +225 -0
- aicf_core-0.5.0/harness/tools/context.py +59 -0
- aicf_core-0.5.0/harness/tools/function_tool.py +93 -0
- aicf_core-0.5.0/harness/tools/mcp.py +549 -0
- aicf_core-0.5.0/harness/tools/registry.py +118 -0
- aicf_core-0.5.0/harness/tools/shell.py +311 -0
- aicf_core-0.5.0/harness/tools/standard.py +778 -0
- aicf_core-0.5.0/harness/tools/toolbox.py +314 -0
- aicf_core-0.5.0/harness/transcript.py +579 -0
- aicf_core-0.5.0/harness/usage.py +143 -0
- aicf_core-0.5.0/infra/__init__.py +13 -0
- aicf_core-0.5.0/infra/auth/__init__.py +21 -0
- aicf_core-0.5.0/infra/auth/api_key.py +101 -0
- aicf_core-0.5.0/infra/auth/base.py +36 -0
- aicf_core-0.5.0/infra/auth/session.py +52 -0
- aicf_core-0.5.0/infra/auth/totp.py +62 -0
- aicf_core-0.5.0/infra/auth/users.py +210 -0
- aicf_core-0.5.0/infra/cache.py +80 -0
- aicf_core-0.5.0/infra/decision/__init__.py +55 -0
- aicf_core-0.5.0/infra/decision/backends.py +93 -0
- aicf_core-0.5.0/infra/decision/client.py +299 -0
- aicf_core-0.5.0/infra/decision/jev.py +256 -0
- aicf_core-0.5.0/infra/finetune/__init__.py +45 -0
- aicf_core-0.5.0/infra/finetune/base.py +196 -0
- aicf_core-0.5.0/infra/finetune/dataset.py +266 -0
- aicf_core-0.5.0/infra/finetune/env.py +256 -0
- aicf_core-0.5.0/infra/finetune/gguf.py +279 -0
- aicf_core-0.5.0/infra/finetune/probe.py +121 -0
- aicf_core-0.5.0/infra/finetune/runner.py +344 -0
- aicf_core-0.5.0/infra/finetune/store.py +205 -0
- aicf_core-0.5.0/infra/finetune/train_sft.py +457 -0
- aicf_core-0.5.0/infra/gateway/__init__.py +7 -0
- aicf_core-0.5.0/infra/gateway/base.py +15 -0
- aicf_core-0.5.0/infra/gateway/flask_adapter.py +27 -0
- aicf_core-0.5.0/infra/models/__init__.py +100 -0
- aicf_core-0.5.0/infra/net.py +301 -0
- aicf_core-0.5.0/infra/observability/__init__.py +15 -0
- aicf_core-0.5.0/infra/observability/core.py +100 -0
- aicf_core-0.5.0/infra/observability/usage.py +94 -0
- aicf_core-0.5.0/infra/orchestrator/__init__.py +129 -0
- aicf_core-0.5.0/infra/orchestrator/anthropic.py +439 -0
- aicf_core-0.5.0/infra/orchestrator/base.py +401 -0
- aicf_core-0.5.0/infra/orchestrator/bonsai.py +236 -0
- aicf_core-0.5.0/infra/orchestrator/dynamic_router.py +394 -0
- aicf_core-0.5.0/infra/orchestrator/failover.py +200 -0
- aicf_core-0.5.0/infra/orchestrator/llamacpp.py +411 -0
- aicf_core-0.5.0/infra/orchestrator/lmstudio.py +317 -0
- aicf_core-0.5.0/infra/orchestrator/local_chat.py +690 -0
- aicf_core-0.5.0/infra/orchestrator/local_engine.py +577 -0
- aicf_core-0.5.0/infra/orchestrator/openai.py +672 -0
- aicf_core-0.5.0/infra/orchestrator/provider.py +64 -0
- aicf_core-0.5.0/infra/orchestrator/router.py +1027 -0
- aicf_core-0.5.0/infra/orchestrator/scheduler.py +761 -0
- aicf_core-0.5.0/infra/orchestrator/strata.py +645 -0
- aicf_core-0.5.0/infra/orchestrator/stub.py +70 -0
- aicf_core-0.5.0/infra/orchestrator/vision.py +385 -0
- aicf_core-0.5.0/infra/policy/__init__.py +32 -0
- aicf_core-0.5.0/infra/policy/budget.py +99 -0
- aicf_core-0.5.0/infra/policy/predictor.py +109 -0
- aicf_core-0.5.0/infra/policy/retry.py +194 -0
- aicf_core-0.5.0/infra/policy/router.py +187 -0
- aicf_core-0.5.0/infra/policy/token_meter.py +166 -0
- aicf_core-0.5.0/infra/policy/warmer.py +92 -0
- aicf_core-0.5.0/infra/resources/__init__.py +51 -0
- aicf_core-0.5.0/infra/resources/decision_service.py +337 -0
- aicf_core-0.5.0/infra/resources/idle.py +177 -0
- aicf_core-0.5.0/infra/resources/launch_modes.py +294 -0
- aicf_core-0.5.0/infra/resources/launchers.py +804 -0
- aicf_core-0.5.0/infra/resources/pool.py +585 -0
- aicf_core-0.5.0/infra/runtime.py +188 -0
- aicf_core-0.5.0/infra/settings.py +127 -0
- aicf_core-0.5.0/infra/store/__init__.py +8 -0
- aicf_core-0.5.0/infra/store/base.py +68 -0
- aicf_core-0.5.0/infra/store/chat_store.py +203 -0
- aicf_core-0.5.0/infra/store/sqlite.py +49 -0
- aicf_core-0.5.0/infra/subapps.py +86 -0
- aicf_core-0.5.0/infra/tasks/__init__.py +18 -0
- aicf_core-0.5.0/infra/tasks/async_store.py +99 -0
- aicf_core-0.5.0/infra/tasks/base.py +104 -0
- aicf_core-0.5.0/infra/tasks/registry.py +102 -0
- aicf_core-0.5.0/infra/tasks/scheduler.py +305 -0
- aicf_core-0.5.0/infra/vector.py +83 -0
- aicf_core-0.5.0/infra/webutil.py +71 -0
- aicf_core-0.5.0/pyproject.toml +74 -0
- aicf_core-0.5.0/setup.cfg +4 -0
- aicf_core-0.5.0/tests/test_agent_collab.py +221 -0
- aicf_core-0.5.0/tests/test_agent_engine.py +305 -0
- aicf_core-0.5.0/tests/test_agent_loop_harness.py +170 -0
- aicf_core-0.5.0/tests/test_api_accounts.py +582 -0
- aicf_core-0.5.0/tests/test_auto_launch_e2e.py +164 -0
- aicf_core-0.5.0/tests/test_auto_launch_status.py +168 -0
- aicf_core-0.5.0/tests/test_batch_skill.py +94 -0
- aicf_core-0.5.0/tests/test_bugfix_regressions.py +543 -0
- aicf_core-0.5.0/tests/test_chat_with_user.py +92 -0
- aicf_core-0.5.0/tests/test_checkin.py +106 -0
- aicf_core-0.5.0/tests/test_client_sessions.py +100 -0
- aicf_core-0.5.0/tests/test_coding_agent.py +50 -0
- aicf_core-0.5.0/tests/test_coding_agent_tools.py +219 -0
- aicf_core-0.5.0/tests/test_context_retention.py +73 -0
- aicf_core-0.5.0/tests/test_conversation_state.py +227 -0
- aicf_core-0.5.0/tests/test_decision_resource.py +249 -0
- aicf_core-0.5.0/tests/test_decision_use_cases.py +188 -0
- aicf_core-0.5.0/tests/test_decisions_core.py +168 -0
- aicf_core-0.5.0/tests/test_dsn_cli_no_auth.py +113 -0
- aicf_core-0.5.0/tests/test_dsn_existence_loop.py +607 -0
- aicf_core-0.5.0/tests/test_dsn_study_asr.py +563 -0
- aicf_core-0.5.0/tests/test_dsn_study_boot.py +229 -0
- aicf_core-0.5.0/tests/test_dsn_study_cache.py +129 -0
- aicf_core-0.5.0/tests/test_dsn_study_checkin.py +187 -0
- aicf_core-0.5.0/tests/test_dsn_study_cli.py +557 -0
- aicf_core-0.5.0/tests/test_dsn_study_context_fix.py +182 -0
- aicf_core-0.5.0/tests/test_dsn_study_context_kernel.py +509 -0
- aicf_core-0.5.0/tests/test_dsn_study_context_v2_integration.py +170 -0
- aicf_core-0.5.0/tests/test_dsn_study_decision.py +314 -0
- aicf_core-0.5.0/tests/test_dsn_study_decision_api.py +87 -0
- aicf_core-0.5.0/tests/test_dsn_study_functional_parity.py +354 -0
- aicf_core-0.5.0/tests/test_dsn_study_idle_shutdown.py +390 -0
- aicf_core-0.5.0/tests/test_dsn_study_mcp_server.py +193 -0
- aicf_core-0.5.0/tests/test_dsn_study_memory.py +145 -0
- aicf_core-0.5.0/tests/test_dsn_study_obsidian.py +317 -0
- aicf_core-0.5.0/tests/test_dsn_study_paper_bundle.py +212 -0
- aicf_core-0.5.0/tests/test_dsn_study_persona_kernel.py +502 -0
- aicf_core-0.5.0/tests/test_dsn_study_personality.py +205 -0
- aicf_core-0.5.0/tests/test_dsn_study_pipeline.py +171 -0
- aicf_core-0.5.0/tests/test_dsn_study_prompts.py +126 -0
- aicf_core-0.5.0/tests/test_dsn_study_session_flow.py +197 -0
- aicf_core-0.5.0/tests/test_dsn_study_tasks.py +201 -0
- aicf_core-0.5.0/tests/test_dsn_study_tool_dispatch.py +146 -0
- aicf_core-0.5.0/tests/test_dsn_study_topics.py +422 -0
- aicf_core-0.5.0/tests/test_dsn_study_vision.py +181 -0
- aicf_core-0.5.0/tests/test_dsn_study_vision_direct.py +727 -0
- aicf_core-0.5.0/tests/test_dsn_study_vision_perception.py +447 -0
- aicf_core-0.5.0/tests/test_dsn_study_vlm.py +300 -0
- aicf_core-0.5.0/tests/test_dsn_study_voice.py +295 -0
- aicf_core-0.5.0/tests/test_dsn_study_voice_latency.py +145 -0
- aicf_core-0.5.0/tests/test_dsn_study_voice_stream.py +301 -0
- aicf_core-0.5.0/tests/test_dsn_study_web_admin.py +217 -0
- aicf_core-0.5.0/tests/test_dsn_ui.py +150 -0
- aicf_core-0.5.0/tests/test_dsn_ui_api_mode.py +218 -0
- aicf_core-0.5.0/tests/test_dsn_ui_api_tools_usage.py +317 -0
- aicf_core-0.5.0/tests/test_dsn_ui_modality_cache.py +184 -0
- aicf_core-0.5.0/tests/test_dsn_ui_multimodal_passthrough.py +127 -0
- aicf_core-0.5.0/tests/test_dsn_ui_resources_perf.py +80 -0
- aicf_core-0.5.0/tests/test_dsn_ui_system1_api.py +176 -0
- aicf_core-0.5.0/tests/test_dsn_ui_tool_roundtrip_cache.py +238 -0
- aicf_core-0.5.0/tests/test_dynamic_router.py +180 -0
- aicf_core-0.5.0/tests/test_emotion_exp.py +227 -0
- aicf_core-0.5.0/tests/test_finetune_api.py +169 -0
- aicf_core-0.5.0/tests/test_funasr.py +194 -0
- aicf_core-0.5.0/tests/test_global_onboarding.py +157 -0
- aicf_core-0.5.0/tests/test_harness_agent.py +145 -0
- aicf_core-0.5.0/tests/test_harness_agent_runtime.py +51 -0
- aicf_core-0.5.0/tests/test_harness_app.py +72 -0
- aicf_core-0.5.0/tests/test_harness_coding.py +208 -0
- aicf_core-0.5.0/tests/test_harness_context_assembly.py +144 -0
- aicf_core-0.5.0/tests/test_harness_infra.py +142 -0
- aicf_core-0.5.0/tests/test_harness_lab.py +120 -0
- aicf_core-0.5.0/tests/test_harness_learning.py +357 -0
- aicf_core-0.5.0/tests/test_harness_llamacpp.py +376 -0
- aicf_core-0.5.0/tests/test_harness_mcp.py +432 -0
- aicf_core-0.5.0/tests/test_harness_memory.py +85 -0
- aicf_core-0.5.0/tests/test_harness_models.py +67 -0
- aicf_core-0.5.0/tests/test_harness_personality_migration.py +82 -0
- aicf_core-0.5.0/tests/test_harness_pipeline.py +183 -0
- aicf_core-0.5.0/tests/test_harness_policy.py +145 -0
- aicf_core-0.5.0/tests/test_harness_probes.py +150 -0
- aicf_core-0.5.0/tests/test_harness_retry.py +96 -0
- aicf_core-0.5.0/tests/test_harness_runtime.py +153 -0
- aicf_core-0.5.0/tests/test_harness_scheduler.py +105 -0
- aicf_core-0.5.0/tests/test_harness_sdk.py +105 -0
- aicf_core-0.5.0/tests/test_harness_selfplay.py +523 -0
- aicf_core-0.5.0/tests/test_harness_settings.py +106 -0
- aicf_core-0.5.0/tests/test_harness_standard_tools.py +87 -0
- aicf_core-0.5.0/tests/test_harness_strata.py +650 -0
- aicf_core-0.5.0/tests/test_harness_stream.py +152 -0
- aicf_core-0.5.0/tests/test_harness_tasks.py +136 -0
- aicf_core-0.5.0/tests/test_harness_toolbox.py +149 -0
- aicf_core-0.5.0/tests/test_harness_tools.py +88 -0
- aicf_core-0.5.0/tests/test_harness_utilities.py +107 -0
- aicf_core-0.5.0/tests/test_harness_v2_innovations.py +137 -0
- aicf_core-0.5.0/tests/test_impression_integration.py +103 -0
- aicf_core-0.5.0/tests/test_infra_finetune.py +673 -0
- aicf_core-0.5.0/tests/test_infra_openai_client.py +173 -0
- aicf_core-0.5.0/tests/test_killpg_guard.py +136 -0
- aicf_core-0.5.0/tests/test_lmstudio.py +81 -0
- aicf_core-0.5.0/tests/test_local_chat_retry.py +143 -0
- aicf_core-0.5.0/tests/test_local_engine_cancel.py +120 -0
- aicf_core-0.5.0/tests/test_local_http_no_proxy.py +101 -0
- aicf_core-0.5.0/tests/test_maintenance.py +507 -0
- aicf_core-0.5.0/tests/test_maintenance_exempt.py +70 -0
- aicf_core-0.5.0/tests/test_media_helpers.py +38 -0
- aicf_core-0.5.0/tests/test_memory.py +416 -0
- aicf_core-0.5.0/tests/test_model_scheduler.py +109 -0
- aicf_core-0.5.0/tests/test_multi_camera.py +361 -0
- aicf_core-0.5.0/tests/test_ncm_music.py +112 -0
- aicf_core-0.5.0/tests/test_obsidian.py +0 -0
- aicf_core-0.5.0/tests/test_onboarding_phases.py +213 -0
- aicf_core-0.5.0/tests/test_orchestrator.py +123 -0
- aicf_core-0.5.0/tests/test_orchestrator_gaps.py +416 -0
- aicf_core-0.5.0/tests/test_orchestrator_load_cancel.py +95 -0
- aicf_core-0.5.0/tests/test_personality_v2_integration.py +66 -0
- aicf_core-0.5.0/tests/test_personality_v2_smoke.py +161 -0
- aicf_core-0.5.0/tests/test_personality_v3_dynamics.py +274 -0
- aicf_core-0.5.0/tests/test_pipeline_preprocess.py +47 -0
- aicf_core-0.5.0/tests/test_plugin_loader.py +442 -0
- aicf_core-0.5.0/tests/test_printer.py +102 -0
- aicf_core-0.5.0/tests/test_prompt_ecosystem.py +340 -0
- aicf_core-0.5.0/tests/test_reboot.py +51 -0
- aicf_core-0.5.0/tests/test_sensing.py +218 -0
- aicf_core-0.5.0/tests/test_skills_system.py +470 -0
- aicf_core-0.5.0/tests/test_stream.py +287 -0
- aicf_core-0.5.0/tests/test_subagent_runner.py +255 -0
- aicf_core-0.5.0/tests/test_todo_plugin.py +413 -0
- aicf_core-0.5.0/tests/test_tools_runtime.py +214 -0
- aicf_core-0.5.0/tests/test_topics.py +350 -0
- aicf_core-0.5.0/tests/test_tracking_vision.py +106 -0
- aicf_core-0.5.0/tests/test_transcript_store.py +235 -0
- aicf_core-0.5.0/tests/test_vlc.py +29 -0
- aicf_core-0.5.0/tests/test_vocal_infer.py +117 -0
- aicf_core-0.5.0/tests/test_webcam.py +264 -0
aicf_core-0.5.0/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Jeffery Darkstar
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
aicf_core-0.5.0/PKG-INFO
ADDED
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: aicf-core
|
|
3
|
+
Version: 0.5.0
|
|
4
|
+
Summary: AICF - Agent Infrastructure Cybernetics Framework: a scenario-agnostic agent engine (turn loop, tools, sqlite sessions, sub-agent collaboration)
|
|
5
|
+
Author-email: Jeffery Darkstar <ccjjfdyqlhy@outlook.com>
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/ccjjfdyqlhy/DSN-exp
|
|
8
|
+
Project-URL: Repository, https://github.com/ccjjfdyqlhy/DSN-exp
|
|
9
|
+
Project-URL: Issues, https://github.com/ccjjfdyqlhy/DSN-exp/issues
|
|
10
|
+
Keywords: agent,llm,tools,sessions,subagents,framework
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
21
|
+
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
22
|
+
Requires-Python: >=3.10
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
Requires-Dist: openai>=1.0.0
|
|
26
|
+
Requires-Dist: requests>=2.28.0
|
|
27
|
+
Requires-Dist: PyYAML>=6.0
|
|
28
|
+
Requires-Dist: python-dotenv>=1.0.0
|
|
29
|
+
Provides-Extra: full
|
|
30
|
+
Requires-Dist: flask>=3.0.0; extra == "full"
|
|
31
|
+
Requires-Dist: fastapi>=0.100; extra == "full"
|
|
32
|
+
Requires-Dist: uvicorn>=0.20; extra == "full"
|
|
33
|
+
Requires-Dist: numpy>=1.24.0; extra == "full"
|
|
34
|
+
Requires-Dist: cryptography>=40.0.0; extra == "full"
|
|
35
|
+
Requires-Dist: rich>=13.0.0; extra == "full"
|
|
36
|
+
Requires-Dist: psutil>=5.9; extra == "full"
|
|
37
|
+
Requires-Dist: opencv-python>=4.8; extra == "full"
|
|
38
|
+
Provides-Extra: mcp
|
|
39
|
+
Requires-Dist: mcp>=1.2.0; extra == "mcp"
|
|
40
|
+
Provides-Extra: anthropic
|
|
41
|
+
Requires-Dist: anthropic>=1.0.0; extra == "anthropic"
|
|
42
|
+
Provides-Extra: socks
|
|
43
|
+
Requires-Dist: httpx[socks]>=0.24; extra == "socks"
|
|
44
|
+
Dynamic: license-file
|
|
45
|
+
|
|
46
|
+
<div align="center">
|
|
47
|
+
<img src="docs/header.svg" width="1200" alt="DSN-exp — Local-First Agent Cybernetics">
|
|
48
|
+
</div>
|
|
49
|
+
|
|
50
|
+
# DSN-exp
|
|
51
|
+
|
|
52
|
+
> 🧠 **Turn a large language model into your own local agent.**
|
|
53
|
+
> Model routing, tool calling, memory, personality, voice and a web console — one base covers it all.
|
|
54
|
+
|
|
55
|
+
[English](README.md) · [中文](README_zh.md) · [文档](docs/README.md)
|
|
56
|
+
|
|
57
|
+

|
|
58
|
+

|
|
59
|
+

|
|
60
|
+

|
|
61
|
+
|
|
62
|
+
**Framework codename AICF** (Agent Infrastructure Cybernetics Framework) · internal experimental project · Apache-2.0
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## 🚀 Start in one command
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
git clone https://github.com/ccjjfdyqlhy/DSN-exp.git && cd DSN-exp && python3 installer.py
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
The installer creates a virtualenv, installs dependencies, checks the repo, walks you through connecting a model, and finally starts the web console:
|
|
73
|
+
|
|
74
|
+
**👉 Open <http://127.0.0.1:8888>, then use "Settings → Provider" in the top-right corner to fill in Base URL and API Key — you can chat right away.**
|
|
75
|
+
|
|
76
|
+
> No GPU? Fine. No local model? Fine.
|
|
77
|
+
> No API key yet? You can still start it and look around.
|
|
78
|
+
|
|
79
|
+
Only want the engine as a library? No clone needed:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
pip install aicf-core
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
That gives you `harness` and `infra` — the turn engine, tools, sqlite
|
|
86
|
+
sessions and sub-agent collaboration — importable from any project.
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## ✨ What it does for you
|
|
91
|
+
|
|
92
|
+
| You might want… | It's here |
|
|
93
|
+
|---|---|
|
|
94
|
+
| A web console that manages models, runs conversations and shows resource usage | **`dsn_ui`**, the default entry point, port `8888` |
|
|
95
|
+
| A voice companion agent that listens and speaks — see the [old README](https://github.com/ccjjfdyqlhy/DSN-exp/blob/main/README_zh.md) | **`dsn`** |
|
|
96
|
+
| Question banks, mock exams, a knowledge graph, study plans | **`dsn_study`** |
|
|
97
|
+
| A coding assistant in the terminal | **`coding_agent`** |
|
|
98
|
+
| A reusable agent base to build your own apps on | `harness/` + [SDK guide](docs/sdk_guide.md) |
|
|
99
|
+
| Local llama.cpp / LM Studio and remote OpenAI-compatible APIs, mixed freely | `infra/orchestrator` |
|
|
100
|
+
| Repo, models and dependencies installed on demand | `python3 onboarding.py` |
|
|
101
|
+
|
|
102
|
+
**In one line: `infra` manages resources, `harness` does the thinking, `apps` carry the product.**
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## 🗺️ The repo in 30 seconds
|
|
107
|
+
|
|
108
|
+
Three layers, dependencies pointing **downward only**:
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
apps/ Product voice companion · web console · study assistant · minimal samples
|
|
112
|
+
│ may only use the capabilities below, and adds product semantics
|
|
113
|
+
▼
|
|
114
|
+
harness/ Agent core agent loop · tools · context · pipeline · memory · personality · SDK
|
|
115
|
+
│ only cares about "messages in, events out"; knows nothing about voice/study/companionship
|
|
116
|
+
▼
|
|
117
|
+
infra/ Infra model routing · resource pool · storage · gateway · auth · policy
|
|
118
|
+
knows nothing about any product
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Your daily entry point is the web console `apps/dsn_ui`. To build an app for a new need, read the
|
|
122
|
+
[app development guide](docs/app-development.md) first and follow `apps/dsn_study`
|
|
123
|
+
(the tidiest structure) and `apps/coding_agent` (the smallest readable one).
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
### Installer usage
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
python3 installer.py # full install + guided setup
|
|
131
|
+
python3 installer.py --doctor # check only, change nothing (best for troubleshooting)
|
|
132
|
+
python3 installer.py --non-interactive # no questions, all defaults (CI / containers)
|
|
133
|
+
python3 installer.py --branch main # switch to a branch before installing
|
|
134
|
+
python3 installer.py --reinstall # rebuild .venv and reinstall dependencies
|
|
135
|
+
python3 installer.py --port 8899 # use another port (when 8888 is taken)
|
|
136
|
+
python3 installer.py --host 0.0.0.0 # allow LAN access (binds 127.0.0.1 by default)
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### 🧭 Not sure what to install? Let the wizard ask you
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
python3 onboarding.py
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## 🎯 What do you want to do next?
|
|
148
|
+
|
|
149
|
+
| I want to… | Start here |
|
|
150
|
+
|---|---|
|
|
151
|
+
| **See what it looks like** | run the installer → open <http://127.0.0.1:8888> |
|
|
152
|
+
| **Configure it automatically** | `python3 onboarding.py` → pick needs/capabilities, it clones repos and downloads models for you |
|
|
153
|
+
| **Chat** | "Settings → Provider" → fill in Base URL + Key |
|
|
154
|
+
| **Run a local model** | prepare a GGUF + `llama-server` → write a profile as in [Model Setup](#model-setup) |
|
|
155
|
+
| **Write a new app** | [App development guide](docs/app-development.md) |
|
|
156
|
+
| **Use AICF as an SDK** | [SDK guide](docs/sdk_guide.md) |
|
|
157
|
+
| **Run the tests / contribute** | [Development and tests](#development-and-tests) |
|
|
158
|
+
| **Troubleshoot the environment** | `python3 installer.py --doctor` → [maintenance guide](docs/maintenance.md) |
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## 🧰 Requirements
|
|
163
|
+
|
|
164
|
+
| Item | Requirement | Notes |
|
|
165
|
+
|---|---|---|
|
|
166
|
+
| Python | **3.10+** (tested on 3.12) | many machines have no `python` command, only `python3` |
|
|
167
|
+
| git | recommended | used to switch branches / update |
|
|
168
|
+
| Node.js | **not needed** | only if you change the frontend sources and rebuild (18+) |
|
|
169
|
+
| GPU | not needed | remote APIs need no graphics card at all; only local models do |
|
|
170
|
+
| Disk | ≥ 2GB | dependencies + models |
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
## ⚙️ Configuration
|
|
174
|
+
|
|
175
|
+
Configuration comes from three places, **in increasing priority**: environment variables > `.env` > code defaults.
|
|
176
|
+
|
|
177
|
+
### Shortest path: configure nothing
|
|
178
|
+
|
|
179
|
+
`dsn_ui` + `densechat` + `emotion_exp` all run with zero configuration. The `.env` the installer writes is
|
|
180
|
+
entirely comments, waiting for you to fill it in.
|
|
181
|
+
|
|
182
|
+
### Configure in the GUI (recommended)
|
|
183
|
+
|
|
184
|
+
Start the console → "Settings → Provider" in the top-right corner → fill in Base URL and API Key → save.
|
|
185
|
+
**No file editing required.**
|
|
186
|
+
|
|
187
|
+
### Configure `.env` by hand
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
cp .env.example .env
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
`.env.example` has 344 lines and 200+ variables, but **almost all of them have defaults** — ignore them.
|
|
194
|
+
Only four are actually used:
|
|
195
|
+
|
|
196
|
+
```ini
|
|
197
|
+
MAIN_MODEL_TYPE=openai
|
|
198
|
+
MAIN_MODEL_NAME=deepseek-chat
|
|
199
|
+
OPENAI_API_BASE=https://api.deepseek.com/v1
|
|
200
|
+
OPENAI_API_KEY=sk-your-real-key
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
> The full variable list is categorised in [configuration.md](docs/configuration.md).
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## Model Setup
|
|
208
|
+
|
|
209
|
+
### Remote API (easiest)
|
|
210
|
+
|
|
211
|
+
Any OpenAI-compatible endpoint works (DeepSeek, OpenAI, GLM, Kimi, vLLM, OneAPI…).
|
|
212
|
+
Just fill in `OPENAI_API_KEY` / `OPENAI_API_BASE` / `MAIN_MODEL_NAME`.
|
|
213
|
+
|
|
214
|
+
### Local llama.cpp
|
|
215
|
+
|
|
216
|
+
You need three things: a compiled `llama-server`, a GGUF weights file, and a model description YAML.
|
|
217
|
+
|
|
218
|
+
```bash
|
|
219
|
+
cp apps/dsn/model_profiles.example/llama_cpp_local.yaml apps/dsn/model_profiles/
|
|
220
|
+
# edit model_path / binary_path inside
|
|
221
|
+
# restart dsn_ui
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
The template directory `apps/dsn/model_profiles.example/` holds samples you can copy,
|
|
225
|
+
and the field reference lives in that directory's `README.md`.
|
|
226
|
+
|
|
227
|
+
> The repo **does not ship** local models with absolute paths — those paths are only valid on the
|
|
228
|
+
> author's machine, and on any other machine they turn into "listed but always fails to load" ghosts.
|
|
229
|
+
> `python3 installer.py --doctor` catches dead paths before they bite.
|
|
230
|
+
|
|
231
|
+
### LM Studio
|
|
232
|
+
|
|
233
|
+
The console connects to `LMSTUDIO_BASE_URL` automatically at startup (default `http://localhost:4501`).
|
|
234
|
+
The web console can also act as a **pure OpenAI-compatible backend** for external clients
|
|
235
|
+
(Open WebUI / Continue / LangChain) — in that mode it uses `passthrough`: no prompt injection,
|
|
236
|
+
no emotion and no memory. See
|
|
237
|
+
[apps/dsn_ui/INTEGRATION_API.md](apps/dsn_ui/INTEGRATION_API.md).
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
## ⌨️ Common commands
|
|
242
|
+
|
|
243
|
+
```bash
|
|
244
|
+
python3 main.py --list # list every registered app
|
|
245
|
+
python3 main.py --app dsn_ui # start the web console
|
|
246
|
+
python3 main.py --app dsn_study # study assistant (Flask, :5000)
|
|
247
|
+
python3 main.py # default app (the DSN UI web console)
|
|
248
|
+
DSN_APP=dsn_ui python3 main.py # the env var works too
|
|
249
|
+
|
|
250
|
+
python3 -m apps.dsn_ui.server --host 0.0.0.0 --port 8888 --slots 2
|
|
251
|
+
python3 -m apps.densechat # DenseChat WebUI (:8080)
|
|
252
|
+
python3 -m apps.emotion_exp # terminal agent
|
|
253
|
+
|
|
254
|
+
python3 installer.py --doctor # environment check (read-only)
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
### Ports at a glance
|
|
258
|
+
|
|
259
|
+
| Port | Service |
|
|
260
|
+
|---|---|
|
|
261
|
+
| 8888 | dsn_ui web console |
|
|
262
|
+
| 8080 | densechat |
|
|
263
|
+
| 5000 | dsn / dsn_study |
|
|
264
|
+
| 5050 | dsn debug endpoint (needs `DEBUG_PLAY_AS_MODEL=true`) |
|
|
265
|
+
| 8008 | dsn admin panel (needs `WEB_ADMIN_ENABLED=true`) |
|
|
266
|
+
| 4501 | LM Studio (connected to) |
|
|
267
|
+
|
|
268
|
+
> ⚠️ `dsn_ui` **must run as a single process**: SSE broadcasting and the stream session registry
|
|
269
|
+
> are in-process singletons — running uvicorn with multiple workers breaks reconnection.
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
|
|
273
|
+
## 🏗️ Architecture at a glance
|
|
274
|
+
|
|
275
|
+
```
|
|
276
|
+
infra/ harness/ apps/
|
|
277
|
+
├─ orchestrator ├─ agent/loop.py ├─ dsn/ voice companion (the largest)
|
|
278
|
+
├─ resources ├─ tools/ (18 std tools) ├─ dsn_ui/ web console (main entry point)
|
|
279
|
+
├─ store ├─ context_assembly.py ├─ dsn_study/ study assistant (the reference app)
|
|
280
|
+
├─ policy ├─ memory/ personality/ ├─ coding_agent/
|
|
281
|
+
├─ gateway ├─ pipeline/ (8 HookPoint) ├─ densechat/
|
|
282
|
+
└─ runtime.py └─ sdk.py └─ emotion_exp/ text_agent/
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
- **Model routing** (`infra/orchestrator`): one contract over llama.cpp / Strata / LM Studio /
|
|
286
|
+
OpenAI / Anthropic backends (`IChatClient` / `IEmbeddingClient`).
|
|
287
|
+
`ModelScheduler` manages VRAM by priority and concurrency slots.
|
|
288
|
+
- **Agent core** (`harness`): multi-step reasoning and tool calls, context trimming under a
|
|
289
|
+
segment budget, vector memory and elastic topic memory, personality dynamics (PEV3),
|
|
290
|
+
pipelines and an event bus, and an embeddable SDK.
|
|
291
|
+
- **Dual-system chat**: some models carry a decision head that answers in one forward pass with
|
|
292
|
+
a calibrated probability. System 2 goes through `POST /v1/chat/completions`, System 1 through
|
|
293
|
+
`POST /v1/decide` (yes/no, choice, score — it returns probabilities), web UI path `/#/decide`.
|
|
294
|
+
|
|
295
|
+
Details in [docs/architecture.md](docs/architecture.md), [docs/harness.md](docs/harness.md) and [docs/infra.md](docs/infra.md).
|
|
296
|
+
|
|
297
|
+
### Applications
|
|
298
|
+
|
|
299
|
+
| App | What it is | Shape |
|
|
300
|
+
|---|---|---|
|
|
301
|
+
| `dsn_ui` | Web console: model management, chat, decisions, resource scheduling | FastAPI + SvelteKit, **main entry point** |
|
|
302
|
+
| `dsn` | Voice companion: real-time audio, emotion system, topic memory | Flask + terminal console, the largest app |
|
|
303
|
+
| `dsn_study` | Study system: question banks, mock exams, knowledge graph | Flask, **the tidiest reference app** |
|
|
304
|
+
| `coding_agent` | Coding assistant sample | terminal REPL |
|
|
305
|
+
| `densechat` | DenseChat WebUI clone | FastAPI |
|
|
306
|
+
| `emotion_exp` | Emotion state machine experiment | terminal |
|
|
307
|
+
| `text_agent` | Minimal placeholder sample | terminal |
|
|
308
|
+
|
|
309
|
+
---
|
|
310
|
+
|
|
311
|
+
## Development and tests
|
|
312
|
+
|
|
313
|
+
```bash
|
|
314
|
+
pip install -r requirements.txt
|
|
315
|
+
pip install pytest # pytest is not in requirements
|
|
316
|
+
python3 -m pytest -q # full run, about 100 seconds
|
|
317
|
+
python3 -m pytest -m known_broken # the cases waiting to be redone
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
> The repo ships a pytest config: `testpaths` limits collection to `tests/`,
|
|
321
|
+
> so running bare `pytest` at the root never wanders into `temp/`
|
|
322
|
+
> (where the scripts would **really call external APIs during collection**).
|
|
323
|
+
|
|
324
|
+
### External MCP tools
|
|
325
|
+
|
|
326
|
+
`harness/tools/mcp.py` provides the MCP bridge; tools appear as `mcp.<server>.<tool>`,
|
|
327
|
+
with server configuration in `mcp_servers.yaml`.
|
|
328
|
+
|
|
329
|
+
---
|
|
330
|
+
|
|
331
|
+
## 📚 Documentation
|
|
332
|
+
|
|
333
|
+
| I want to… | Read this |
|
|
334
|
+
|---|---|
|
|
335
|
+
| Build the mental model and learn the module map | [docs/architecture.md](docs/architecture.md) |
|
|
336
|
+
| Go deeper into the agent loop / tools / context | [docs/harness.md](docs/harness.md) |
|
|
337
|
+
| Go deeper into model routing / resource pool / storage | [docs/infra.md](docs/infra.md) |
|
|
338
|
+
| **Run it locally and troubleshoot the environment** | [docs/getting-started.md](docs/getting-started.md) |
|
|
339
|
+
| **Extend an existing app / write a new one** | [docs/app-development.md](docs/app-development.md) |
|
|
340
|
+
| Know what each app does and how to start it | [docs/apps.md](docs/apps.md) |
|
|
341
|
+
| Embed AICF as an SDK in your own project | [docs/sdk_guide.md](docs/sdk_guide.md) |
|
|
342
|
+
| **Know which traps not to step into before changing code** | [docs/maintenance.md](docs/maintenance.md) |
|
|
343
|
+
| Configuration keys / environment variables | [docs/configuration.md](docs/configuration.md) |
|
|
344
|
+
| Run tests and read a failure | [docs/testing.md](docs/testing.md) |
|
|
345
|
+
| **Known tech debt and its fix priority** | [docs/technical-debt.md](docs/technical-debt.md) |
|
|
346
|
+
|
|
347
|
+
---
|
|
348
|
+
|
|
349
|
+
## 📌 Project status
|
|
350
|
+
|
|
351
|
+
[](https://repostars.dev/?repos=ccjjfdyqlhy%2FDSN-exp&theme=ocean)
|