mirror of
https://github.com/Routstr/routstr-core.git
synced 2026-10-05 20:28:23 +00:00
Merge pull request #105 from Routstr/fix-models-auto-fetch
Fix models auto fetch
This commit is contained in:
@@ -10,6 +10,7 @@ wallet.sqlite3
|
||||
*models.json
|
||||
.cashu
|
||||
.dockerignore
|
||||
relay-data
|
||||
|
||||
compose.override.yml
|
||||
|
||||
|
||||
@@ -77,7 +77,6 @@ app.add_middleware(
|
||||
@app.get("/", include_in_schema=False)
|
||||
@app.get("/v1/info")
|
||||
async def info() -> dict:
|
||||
logger.info("Info endpoint accessed")
|
||||
return {
|
||||
"name": app.title,
|
||||
"description": app.description,
|
||||
|
||||
@@ -110,18 +110,6 @@ def load_models() -> list[Model]:
|
||||
print(f"Error loading models from {models_path}: {e}")
|
||||
# Fall through to auto-generation
|
||||
|
||||
# Check for example file as fallback
|
||||
example = Path(__file__).resolve().parent.parent.parent / "models.example.json"
|
||||
if example.exists():
|
||||
print(f"Loading models from example file: {example}")
|
||||
try:
|
||||
with example.open("r") as f:
|
||||
data = json.load(f)
|
||||
return [Model(**model) for model in data.get("models", [])]
|
||||
except Exception as e:
|
||||
print(f"Error loading models from {example}: {e}")
|
||||
# Fall through to auto-generation
|
||||
|
||||
# Auto-generate models from OpenRouter API
|
||||
print("Auto-generating models from OpenRouter API")
|
||||
source_filter = os.getenv("SOURCE")
|
||||
|
||||
Reference in New Issue
Block a user